Skip to content
ConsoleMonster
Class

TestRunView

ConsoleMonster.TestRuns

Namespace
ConsoleMonster.TestRuns
Assembly
ConsoleMonster
Modifiers
sealed

The live view of a TestRun, drawn with the shared dashboard chrome (see Docs/Design-System.md): the header bar with the run totals, the status and the clock; the test files as lanes (running, passed, failed and skipped counts); the running test; and, in the full layout, the failures (expected against actual, file and line as a link), the slowest tests and a histogram of test durations. The compact layout (for inline areas) keeps the files, the running test and the first failures. Each frame renders a fresh snapshot, so the run can be fed from any thread.

Inheritance

  • object
  • TestRunView

Usage

Explore 16 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 8

Constructors

public TestRunView(TestRun run) #

Creates the view.

Parameters

run ConsoleMonster.TestRuns.TestRun required
The run.

Methods

public IWidget Build(TestRunSnapshot snapshot, int width, int height, RenderContext context) #

Builds the widgets for one snapshot at a size (used for each frame and for exports of the final state).

Parameters

snapshot ConsoleMonster.TestRuns.TestRunSnapshot required
The snapshot.
width int required
The width.
height int required
The height.
context ConsoleMonster.Canvas.RenderContext required
The render context.

Returns

IWidget The dashboard.
public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.
public bool TryGetTaskbarProgress(out TaskbarState state, out double fraction) #

The run for the terminal's indicator: tests done of the total, red once a test failed.

Parameters

state ConsoleMonster.Output.TaskbarState required
The state.
fraction double required
The fraction done, or NaN while the total is unknown.

Returns

bool False once the run passed.

Properties

public string? Title { get; set; } #

The header title, or null (default) for the built-in word ("Tests" in English).

public bool Compact { get; set; } #

Draws the compact layout (files, running test, first failures) at the height it needs.

public int CompactFiles { get; set; } #

The most file lanes the compact layout shows (default 6).

public int CompactFailures { get; set; } #

The most failures the compact layout shows (default 2).

Extension Methods

public static TestRunView Compact(TestRunView testRunView, bool value = true) #

Sets TestRunView.Compact: Draws the compact layout (files, running test, first failures) at the height it needs.

Parameters

testRunView ConsoleMonster.TestRuns.TestRunView required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TestRunView The same instance.

Examples

// C# initializer or property    // C# fluent
testRunView.Compact = value;     testRunView.Compact(value);
public static TestRunView CompactFailures(TestRunView testRunView, int value) #

Sets TestRunView.CompactFailures: The most failures the compact layout shows (default 2).

Parameters

testRunView ConsoleMonster.TestRuns.TestRunView required
The instance.
value int required
The value.

Returns

TestRunView The same instance.

Examples

// C# initializer or property           // C# fluent
testRunView.CompactFailures = value;    testRunView.CompactFailures(value);
public static TestRunView CompactFiles(TestRunView testRunView, int value) #

Sets TestRunView.CompactFiles: The most file lanes the compact layout shows (default 6).

Parameters

testRunView ConsoleMonster.TestRuns.TestRunView required
The instance.
value int required
The value.

Returns

TestRunView The same instance.

Examples

// C# initializer or property        // C# fluent
testRunView.CompactFiles = value;    testRunView.CompactFiles(value);
public static TestRunView Title(TestRunView testRunView, string? value) #

Sets TestRunView.Title: The header title, or null (default) for the built-in word ("Tests" in English).

Parameters

testRunView ConsoleMonster.TestRuns.TestRunView required
The instance.
value string? required
The value.

Returns

TestRunView The same instance.

Examples

// C# initializer or property    // C# fluent
testRunView.Title = value;       testRunView.Title(value);