TestCapabilities Class

Represents fake capabilities useful in tests.
public sealed class TestCapabilities : IReadOnlyCapabilities

Properties

bool Ansi
Gets a value indicating whether or not the console supports VT/ANSI control codes.
ColorSystem ColorSystem
Gets the color system.
bool Interactive
Gets a value indicating whether or not the console supports interaction.
bool IsTerminal
Gets a value indicating whether or not console output has been redirected.
bool Legacy
Gets a value indicating whether or not this is a legacy console (cmd.exe) on an OS prior to Windows 10.
bool Links
Gets a value indicating whether or not the console support links.
bool Unicode
Gets a value indicating whether or not the console supports Unicode.

Methods

RenderOptions CreateRenderContext(IAnsiConsole)
Creates a RenderOptions with the same capabilities as this instace.

Extension Methods

T And<TestCapabilities>(Action<TestCapabilities>)
Performs the specified action on the given object and then returns the object. Useful for fluent testing patterns where additional assertions or operations are chained together in a readable manner.