namespace Spectre.Console.Testing; /// /// Contains extensions for . /// public static class TestConsoleExtensions { /// /// Sets the console's color system. /// /// The console. /// The color system to use. /// The same instance so that multiple calls can be chained. public static TestConsole Colors(this TestConsole console, ColorSystem colors) { console.Profile.Capabilities.ColorSystem = colors; return console; } /// /// Sets whether or not ANSI is supported. /// /// The console. /// Whether or not VT/ANSI control codes are supported. /// The same instance so that multiple calls can be chained. public static TestConsole SupportsAnsi(this TestConsole console, bool enable) { console.Profile.Capabilities.Ansi = enable; return console; } /// /// Makes the console interactive. /// /// The console. /// The same instance so that multiple calls can be chained. public static TestConsole Interactive(this TestConsole console) { console.Profile.Capabilities.Interactive = true; return console; } /// /// Sets the console width. /// /// The console. /// The console width. /// The same instance so that multiple calls can be chained. public static TestConsole Width(this TestConsole console, int width) { console.Profile.Width = width; return console; } /// /// Sets the console height. /// /// The console. /// The console height. /// The same instance so that multiple calls can be chained. public static TestConsole Height(this TestConsole console, int width) { console.Profile.Height = width; return console; } /// /// Sets the console size. /// /// The console. /// The console size. /// The same instance so that multiple calls can be chained. public static TestConsole Size(this TestConsole console, Size size) { console.Profile.Width = size.Width; console.Profile.Height = size.Height; return console; } /// /// Turns on emitting of VT/ANSI sequences. /// /// The console. /// The same instance so that multiple calls can be chained. public static TestConsole EmitAnsiSequences(this TestConsole console) { console.SetCursor(null); console.EmitAnsiSequences = true; return console; } }