API Reference
TestRunText
The text of a test run, shared by the live view, the summary and the stream lines, so a failure reads the same everywhere: the status symbol, the blocks and test name joined by the breadcrumb chevron, expected against actual (or the message), and the file and line as a link.
Inheritance
- Object
- TestRunText
Methods
public static String FailureLine(TestRecord record, IGlyphSet glyphs) #StringOne line for a failure in stream output: symbol, path, the first message line or expected and actual, and the location.
Parameters
- record ConsoleMonster.TestRuns.TestRecord
- The failure.
- glyphs ConsoleMonster.Glyphs.IGlyphSet
- The glyph set.
Returns
The line (plain text).
public static List<StyledLine> FailureLines(TestRecord record, RenderContext context, Int32 messageLines = 3) #List<StyledLine>The lines of one failure: the symbol and path, expected and actual (the characters of the actual value that differ are underlined) or up to messageLines lines of the message, and the location as a link.
Parameters
- record ConsoleMonster.TestRuns.TestRecord
- The failure.
- context ConsoleMonster.Canvas.RenderContext
- The render context.
- messageLines System.Int32 = 3
- The most message lines to show.
Returns
The lines.
public static String? Link(TestRecord record) #String?A file URI for the record's file, or null.
Parameters
- record ConsoleMonster.TestRuns.TestRecord
- The record.
Returns
The URI.
public static String? Location(TestRecord record) #String?The location as "file:line" (the file name only), or null when the file is unknown.
Parameters
- record ConsoleMonster.TestRuns.TestRecord
- The record.
Returns
The text.
public static String Outcome(StatusKind status) #StringThe outcome words for a run status (Tests failed, Tests inconclusive, Tests passed), translated.
Parameters
- status ConsoleMonster.Styling.StatusKind
- The run status.
Returns
The words.
public static String Path(IReadOnlyList<String> blocks, String name, IGlyphSet glyphs) #StringThe blocks and the test name joined by the breadcrumb separator (› or >).
Parameters
- blocks System.Collections.Generic.IReadOnlyList<System.String>
- The blocks.
- name System.String
- The test name.
- glyphs ConsoleMonster.Glyphs.IGlyphSet
- The glyph set.
Returns
The path.
public static String SummaryLine(TestRunSnapshot snapshot, IGlyphSet glyphs) #StringThe closing line for stream output: the status symbol, the outcome and the totals.
Parameters
- snapshot ConsoleMonster.TestRuns.TestRunSnapshot
- The snapshot.
- glyphs ConsoleMonster.Glyphs.IGlyphSet
- The glyph set.
Returns
The line (plain text).
public static String Totals(TestRunSnapshot snapshot, IGlyphSet glyphs, Boolean clock = true) #StringThe run totals: "3 failed · 3 passed · 1 skipped · 7 tests · 00:00:01" (separators per tier).
Parameters
- snapshot ConsoleMonster.TestRuns.TestRunSnapshot
- The snapshot.
- glyphs ConsoleMonster.Glyphs.IGlyphSet
- The glyph set.
- clock System.Boolean = true
- Whether to end with the run clock.
Returns
The facts.
public static Boolean TryParseExpectation(String? message, out String expected, out String actual) #BooleanReads expected and actual values from an assertion message ("Expected 4, but got 3.", or the "Expected:" and "But was:" lines of a string comparison). Quotes around both values are removed.
Parameters
- message System.String?
- The message.
- expected System.String
- The expected value.
- actual System.String
- The actual value.
Returns
Whether both were found.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?