Class FakeOutput
Fake console output for testing that captures what would be written to the console.
public class FakeOutput : OutputBase, IOutput, IDisposable
- Inheritance
-
FakeOutput
- Implements
- Inherited Members
Constructors
Properties
- LastBuffer
Gets or sets the last output buffer written.
- Output
Gets the captured output as a string.
Methods
- AppendOrWriteAttribute(StringBuilder, Attribute, TextStyle)
Changes the color and text style of the console to the given
attrandredrawTextStyle. If command can be buffered in line with other output (e.g. CSI sequence) then it should be appended tooutputotherwise the relevant output state should be flushed directly (e.g. by calling relevant win 32 API method)
- Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- GetCursorPosition()
Gets the current position of the console cursor.
- GetSize()
Returns the current size of the console in rows/columns (i.e. of characters not pixels).
- SetCursorPosition(int, int)
Moves the console cursor to the given location.
- SetCursorPositionImpl(int, int)
When overriden in derived class, positions the terminal output cursor to the specified point on the screen.
- SetCursorVisibility(CursorVisibility)
Base interface for Terminal.Gui Driver implementations.
- SetSize(int, int)
Sets the size of the console.
- Write(ReadOnlySpan<char>)
Writes the given text directly to the console. Use to send ansi escape codes etc. Regular screen output should use the IOutputBuffer overload.
- Write(StringBuilder)
Output the contents of the
outputto the console.
- Write(IOutputBuffer)
Base interface for Terminal.Gui Driver implementations.