TestRun
ConsoleMonster.TestRuns
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) #A container ended.
Parameters
- key string
- The container key.
public void ContainerQueued(string key, string name, string? file, int tests = 0) #A container is known before it runs (a test file found up front, or discovered): it shows as queued.
Parameters
- key string
- A unique key (the file path).
- name string
- The display name (the file name).
- file string?
- The full path, or null.
- tests int = 0
- The tests it will run, or 0 when not known yet.
public void ContainerStarted(string key, string name, string? file, int tests) #A container (a test file or script block) starts.
Parameters
- key string
- A unique key (the file path).
- name string
- The display name (the file name).
- file string?
- The full path, or null.
- tests int
- The tests it will run, or 0 when unknown.
public void Discovered(int total) #Discovery finished: the number of tests that will run.
Parameters
- total int
- The planned test count.
public TestRunSnapshot Snapshot() #A consistent copy of the state, for rendering on another thread.
public void TestFinished(TestRecord record) #A test ended (or, with TestRecord.IsBlockFailure, a block failed outside a test). Failures and errors with a message are listed; a failed test without a message (it failed because its block did) is only counted. A record with a TestRecord.Group is also counted under that group, and skipped or not-run records are counted by their reason.
Parameters
- record ConsoleMonster.TestRuns.TestRecord
- The record.
public void TestStarted(string container, IReadOnlyList<string>? blocks, string name) #A test starts.
Parameters
- container string
- The container key.
- blocks System.Collections.Generic.IReadOnlyList<string>?
- The enclosing blocks, outermost first.
- name string
- The test name.
Inherited Methods
Properties
public int SlowestCount { get; set; } #How many slowest tests snapshots keep (default 5).