API Reference
TestRecord
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
- Property TestRunSnapshot.Failures
- Property TestRunSnapshot.Slowest
Accepted by parameters 5
- Method TestRun.TestFinished
- Method TestRunText.FailureLine
- Method TestRunText.FailureLines
- Method TestRunText.Link
- Method TestRunText.Location
Constructors
public TestRecord(String container, String name, StatusKind status) #Creates a record.
Parameters
- container System.String
- The container key (a test file, usually its full path).
- name System.String
- The test name (expanded, as reported).
- status ConsoleMonster.Styling.StatusKind
- How it ended: Pass, Fail, Skip, Warn (inconclusive) or Pending (not run).
Methods
public static StatusKind ParseStatus(String? result) #StatusKindThe 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?
- The result word.
Returns
The status.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public IReadOnlyList<String> Blocks { get; set; } #The enclosing blocks, outermost first (Describe, Context).
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).