Skip to content
ConsoleMonster

API Reference

Class

TestRunView

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 requiredposition: 0
The run.

Methods

public IWidget Build(TestRunSnapshot snapshot, Int32 width, Int32 height, RenderContext context) #
Returns: IWidget

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 requiredposition: 0
The snapshot.
width System.Int32 requiredposition: 1
The width.
height System.Int32 requiredposition: 2
The height.
context ConsoleMonster.Canvas.RenderContext requiredposition: 3
The render context.

Returns

The dashboard.

public Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public Void Render(Region region, RenderContext context) #
Returns: Void

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

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.
public Boolean TryGetTaskbarProgress(out TaskbarState state, out Double fraction) #
Returns: Boolean

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

Parameters

state ConsoleMonster.Output.TaskbarState requiredposition: 0
The state.
fraction System.Double requiredposition: 1
The fraction done, or NaN while the total is unknown.

Returns

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 Boolean Compact { get; set; } #

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

public Int32 CompactFiles { get; set; } #

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

public Int32 CompactFailures { get; set; } #

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

Extension Methods

public static TestRunView WithCompact(TestRunView testRunView, Boolean value = true) #
Returns: TestRunView

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

Parameters

testRunView ConsoleMonster.TestRuns.TestRunView requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TestRunView WithCompactFailures(TestRunView testRunView, Int32 value) #
Returns: TestRunView

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

Parameters

testRunView ConsoleMonster.TestRuns.TestRunView requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static TestRunView WithCompactFiles(TestRunView testRunView, Int32 value) #
Returns: TestRunView

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

Parameters

testRunView ConsoleMonster.TestRuns.TestRunView requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static TestRunView WithTitle(TestRunView testRunView, String? value) #
Returns: TestRunView

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

Parameters

testRunView ConsoleMonster.TestRuns.TestRunView requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.