Class XunitTestClassRunner
The test class runner for xUnit.net v3 tests.
public class XunitTestClassRunner : XunitTestClassRunnerBase<XunitTestClassRunnerContext, IXunitTestClass, IXunitTestMethod, IXunitTestCase>
- Inheritance
-
XunitTestClassRunnerBase<XunitTestClassRunnerContext, IXunitTestClass, IXunitTestMethod, IXunitTestCase>XunitTestClassRunner
- Inherited Members
Constructors
XunitTestClassRunner()
Initializes a new instance of the XunitTestClassRunner class.
protected XunitTestClassRunner()
Properties
Instance
Gets the singleton instance of the XunitTestClassRunner class.
public static XunitTestClassRunner Instance { get; }
Property Value
Methods
Run(IXunitTestClass, IReadOnlyCollection<IXunitTestCase>, ExplicitOption, IMessageBus, ITestCaseOrderer, ExceptionAggregator, CancellationTokenSource, FixtureMappingManager)
Runs the test class.
public ValueTask<RunSummary> Run(IXunitTestClass testClass, IReadOnlyCollection<IXunitTestCase> testCases, ExplicitOption explicitOption, IMessageBus messageBus, ITestCaseOrderer testCaseOrderer, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource, FixtureMappingManager collectionFixtureMappings)
Parameters
testClassIXunitTestClassThe test class to be run.
testCasesIReadOnlyCollection<IXunitTestCase>The test cases to be run. Cannot be empty.
explicitOptionExplicitOptionA flag to indicate how explicit tests should be treated.
messageBusIMessageBusThe message bus to report run status to.
testCaseOrdererITestCaseOrdererThe test case orderer that will be used to decide how to order the test.
aggregatorExceptionAggregatorThe exception aggregator used to run code and collect exceptions.
cancellationTokenSourceCancellationTokenSourceThe task cancellation token source, used to cancel the test run.
collectionFixtureMappingsFixtureMappingManagerThe mapping of collection fixture types to fixtures.
Returns
RunTestMethod(XunitTestClassRunnerContext, IXunitTestMethod?, IReadOnlyCollection<IXunitTestCase>, object?[])
Override this method to run the tests in an individual test method.
protected override ValueTask<RunSummary> RunTestMethod(XunitTestClassRunnerContext ctxt, IXunitTestMethod? testMethod, IReadOnlyCollection<IXunitTestCase> testCases, object?[] constructorArguments)
Parameters
ctxtXunitTestClassRunnerContextThe context that describes the current test class
testMethodIXunitTestMethodThe test method that contains the test cases. May be
nullfor test cases that do not support classes and methods.testCasesIReadOnlyCollection<IXunitTestCase>The test cases to be run.
constructorArgumentsobject[]The constructor arguments that will be used to create the test class.
Returns
- ValueTask<RunSummary>
Returns summary information about the tests that were run.