API Reference
TestRun
The state of a test run, fed with events from a test framework adapter (discovery, container start, test start, test end, container end, run end) on any thread, and read by TestRunView and TestRunSummary through consistent snapshots. It knows nothing about a specific framework.
Inheritance
- Object
- TestRun
Usage
Explore 1 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 1
- Constructor TestRunView.TestRunView
Constructors
public TestRun(Func<TimeSpan>? clock = null) #Creates a run.
Parameters
- clock System.Func<System.TimeSpan>? = null
- The run clock (elapsed time since the run started); null uses a stopwatch started now.
Methods
public Void ContainerFinished(String key) #VoidA container ended.
Parameters
- key System.String
- The container key.
public Void ContainerQueued(String key, String name, String? file, Int32 tests = 0) #VoidA container is known before it runs (a test file found up front, or discovered): it shows as queued.
Parameters
- key System.String
- A unique key (the file path).
- name System.String
- The display name (the file name).
- file System.String?
- The full path, or null.
- tests System.Int32 = 0
- The tests it will run, or 0 when not known yet.
public Void ContainerStarted(String key, String name, String? file, Int32 tests) #VoidA container (a test file or script block) starts.
Parameters
- key System.String
- A unique key (the file path).
- name System.String
- The display name (the file name).
- file System.String?
- The full path, or null.
- tests System.Int32
- The tests it will run, or 0 when unknown.
public Void Discovered(Int32 total) #VoidDiscovery finished: the number of tests that will run.
Parameters
- total System.Int32
- The planned test count.
public TestRunSnapshot Snapshot() #TestRunSnapshotA consistent copy of the state, for rendering on another thread.
Returns
The snapshot.
public Void TestFinished(TestRecord record) #VoidA test ended (or, with TestRecord.IsBlockFailure, a block failed outside a test). Failures with a message are listed; a failed test without a message (it failed because its block did) is only counted.
Parameters
- record ConsoleMonster.TestRuns.TestRecord
- The record.
public Void TestStarted(String container, IReadOnlyList<String>? blocks, String name) #VoidA test starts.
Parameters
- container System.String
- The container key.
- blocks System.Collections.Generic.IReadOnlyList<System.String>?
- The enclosing blocks, outermost first.
- name System.String
- The test name.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public Int32 SlowestCount { get; set; } #How many slowest tests snapshots keep (default 5).