TestConsoleInput Class
Represents a testable console input mechanism.
public sealed class TestConsoleInput : IAnsiConsoleInput
- Namespace
- Spectre
.Console .Testing - Interfaces
Constructors
-
TestConsoleInput
() -
Initializes a new instance of the
TestConsoleInput
class.
Methods
-
bool IsKeyAvailable
() - Gets a value indicating whether or not there is a key available.
-
void PushCharacter
(char) - Pushes the specified character to the input queue.
-
void PushKey
(ConsoleKey) - Pushes the specified key to the input queue.
-
void PushKey
(ConsoleKeyInfo) - Pushes the specified key to the input queue.
-
void PushText
(string) - Pushes the specified text to the input queue.
-
void PushTextWithEnter
(string) - Pushes the specified text followed by 'Enter' to the input queue.
-
ConsoleKeyInfo? ReadKey
(bool) - Reads a key from the console.
-
Task<ConsoleKeyInfo?> ReadKeyAsync
(bool, CancellationToken) - Reads a key from the console.