Skip to content
ConsoleMonster

API Reference

Class

TestRecord

Namespace ConsoleMonster.TestRuns
Assembly ConsoleMonster
Modifiers sealed

One finished test of a TestRun: where it lives (container, blocks), how it ended, how long it took, and for a failure the message and the location. Test frameworks are mapped onto it by adapters (for example Invoke-ConsolePester for Pester).

Inheritance

  • Object
  • TestRecord

Usage

Explore 7 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.

Returned or exposed by 2

Accepted by parameters 5

Constructors

public TestRecord(String container, String name, StatusKind status) #

Creates a record.

Parameters

container System.String requiredposition: 0
The container key (a test file, usually its full path).
name System.String requiredposition: 1
The test name (expanded, as reported).
status ConsoleMonster.Styling.StatusKind requiredposition: 2
How it ended: Pass, Fail, Skip, Warn (inconclusive) or Pending (not run).

Methods

public static StatusKind ParseStatus(String? result) #
Returns: StatusKind

The status for a test framework's result word: Passed, Failed, Skipped, Inconclusive or NotRun (Pester, xUnit, NUnit and MSTest use these words); anything else is Pending.

Parameters

result System.String? requiredposition: 0
The result word.

Returns

The status.

Properties

public String Container { get; } #

The container key.

public String Name { get; } #

The test name.

public StatusKind Status { get; } #

How the test ended.

public IReadOnlyList<String> Blocks { get; set; } #

The enclosing blocks, outermost first (Describe, Context).

public TimeSpan Duration { get; set; } #

How long the test took.

public String? Message { get; set; } #

The failure message, or null.

public String? File { get; set; } #

The file of the failing line (or of the test), or null.

public Int32 Line { get; set; } #

The failing line (or the test's first line), or 0 when unknown.

public String? ErrorType { get; set; } #

The exception type of an error that is not an assertion (shown before the message), or null.

public Boolean IsBlockFailure { get; set; } #

Whether the record stands for a block or container that failed outside a test (setup, teardown, discovery).