Class XunitTestCaseRunner
The test case runner for xUnit.net v3 tests.
public class XunitTestCaseRunner : XunitTestCaseRunnerBase<XunitTestCaseRunnerContext, IXunitTestCase, IXunitTest>
- Inheritance
-
XunitTestCaseRunner
- Inherited Members
Constructors
XunitTestCaseRunner()
Initializes a new instance of the XunitTestCaseRunner class.
protected XunitTestCaseRunner()
Properties
Instance
Gets the singleton instance of the XunitTestCaseRunner class.
public static XunitTestCaseRunner Instance { get; }
Property Value
Methods
Run(IXunitTestCase, IReadOnlyCollection<IXunitTest>, IMessageBus, ExceptionAggregator, CancellationTokenSource, string, string?, ExplicitOption, object?[])
Runs the test case.
public ValueTask<RunSummary> Run(IXunitTestCase testCase, IReadOnlyCollection<IXunitTest> tests, IMessageBus messageBus, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource, string displayName, string? skipReason, ExplicitOption explicitOption, object?[] constructorArguments)
Parameters
testCaseIXunitTestCaseThe test case that this invocation belongs to.
testsIReadOnlyCollection<IXunitTest>The tests for the test case.
messageBusIMessageBusThe message bus to report run status to.
aggregatorExceptionAggregatorThe exception aggregator used to run code and collect exceptions.
cancellationTokenSourceCancellationTokenSourceThe task cancellation token source, used to cancel the test run.
displayNamestringThe display name of the test case.
skipReasonstringThe skip reason, if the test is to be skipped.
explicitOptionExplicitOptionA flag to indicate how explicit tests should be treated.
constructorArgumentsobject[]The arguments to be passed to the test class constructor.
Returns
- ValueTask<RunSummary>
Returns summary information about the test that was run.
Remarks
This entry point is used for both single-test (like FactAttribute and individual data rows for TheoryAttribute tests) and multi-test test cases (like TheoryAttribute when pre-enumeration is disable or the theory data was not serializable).
RunTest(XunitTestCaseRunnerContext, IXunitTest)
Override this method to run an individual test.
protected override ValueTask<RunSummary> RunTest(XunitTestCaseRunnerContext ctxt, IXunitTest test)
Parameters
ctxtXunitTestCaseRunnerContextThe context that describes the current test method
testIXunitTestThe test to be run.
Returns
- ValueTask<RunSummary>
Returns summary information about the test case run.