mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00

- A `Text` object should not be able to justify itself. All justification needs to be done by a parent. - Apply colors and styles to part of a `Text` object - Markup parser should return a `Text` object
33 lines
815 B
C#
33 lines
815 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace Spectre.Console.Tests
|
|
{
|
|
public sealed class AnsiConsoleFixture : IDisposable
|
|
{
|
|
private readonly StringWriter _writer;
|
|
|
|
public IAnsiConsole Console { get; }
|
|
|
|
public string Output => _writer.ToString();
|
|
|
|
public AnsiConsoleFixture(ColorSystem system, AnsiSupport ansi = AnsiSupport.Yes, int width = 80)
|
|
{
|
|
_writer = new StringWriter();
|
|
|
|
Console = new ConsoleWithWidth(
|
|
AnsiConsole.Create(new AnsiConsoleSettings
|
|
{
|
|
Ansi = ansi,
|
|
ColorSystem = (ColorSystemSupport)system,
|
|
Out = _writer,
|
|
}), width);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
_writer?.Dispose();
|
|
}
|
|
}
|
|
}
|