/// <summary> /// Initializes a new instance of the <see cref="TestConsole"/> class. /// </summary> public TestConsole() { _writer = new StringWriter(); _cursor = new NoopCursor(); Input = new TestConsoleInput(); EmitAnsiSequences = false; _console = AnsiConsole.Create(new AnsiConsoleSettings { Ansi = AnsiSupport.Yes, ColorSystem = (ColorSystemSupport)ColorSystem.TrueColor, Out = new AnsiConsoleOutput(_writer), Interactive = InteractionSupport.No, ExclusivityMode = new NoopExclusivityMode(), Enrichment = new ProfileEnrichment { UseDefaultEnrichers = false, }, }); _console.Profile.Width = 80; _console.Profile.Height = 24; _console.Profile.Capabilities.Ansi = true; _console.Profile.Capabilities.Unicode = true; }
public static void PushKeys(this TestConsoleInput testConsoleInput, params ConsoleKey[] inputs) { foreach (var input in inputs) { testConsoleInput.PushKey(input); } }
public static void PushTextsWithEnter(this TestConsoleInput testConsoleInput, params string[] inputs) { foreach (var input in inputs) { testConsoleInput.PushTextWithEnter(input); } }
public static void PushCharacters(this TestConsoleInput testConsoleInput, string inputs) { foreach (var input in inputs) { testConsoleInput.PushCharacter(input); } }