FakeConsole Class

Summary

Implementation of a fake IConsole.
Namespace
Cake.Testing
Interfaces
Base Types
  • object
graph BT Type-->Base0["object"] Type-.->Interface0["IConsole"] click Interface0 "/api/Cake.Core/IConsole" Type["FakeConsole"] class Type type-node

Syntax

public sealed class FakeConsole : IConsole

Constructors

Name Summary
FakeConsole() Initializes a new instance of the FakeConsole class.

Properties

Name Value Summary
BackgroundColor ConsoleColor
Gets or sets the background color.
ErrorMessages List<string>
Gets or sets the error messages.
ForegroundColor ConsoleColor
Gets or sets the foreground color.
Messages List<string>
Gets or sets the messages.
OutputConsoleColor bool
Gets or sets a value indicating whether console color should be added to the text string if SupportAnsiEscapeCodes is set to false.
SupportAnsiEscapeCodes bool
Gets a value indicating whether or not the console supports ANSI escape codes.

Methods

Name Value Summary
CreateAnsiConsole() FakeConsole
Creates a new fake console that supports ANSI escape codes.
static
ResetColor() void
Sets the foreground and background console colors to their defaults.
Write(string, object[]) void
Writes the text representation of the specified array of objects to the console output using the specified format information.
WriteError(string, object[]) void
Writes the text representation of the specified array of objects to the console error output using the specified format information.
WriteErrorLine(string, object[]) void
Writes the text representation of the specified array of objects, followed by the current line terminator, to the console error output using the specified format information.
WriteLine(string, object[]) void
Writes the text representation of the specified array of objects, followed by the current line terminator, to the console output using the specified format information.

Extension Methods

Name Value Summary
Dump<FakeConsole>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<FakeConsole>(FakeConsole[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<FakeConsole>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
NotNull<FakeConsole>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
ThrowIfNull<FakeConsole>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<FakeConsole>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Returns the string value or a Not set> markup suitable for Spectre.Console.
Requires the Cake.Issues addin
WriteErrorLine() void
Writes an empty line to the console error output.
WriteLine() void
Writes an empty line to the console output.