Class XunitTestCollectionRunnerBase<TContext, TTestCollection, TTestClass, TTestCase>
The test collection runner for xUnit.net v3 tests (with overridable context).
public abstract class XunitTestCollectionRunnerBase<TContext, TTestCollection, TTestClass, TTestCase> : TestCollectionRunner<TContext, TTestCollection, TTestClass, TTestCase> where TContext : XunitTestCollectionRunnerBaseContext<TTestCollection, TTestCase> where TTestCollection : class, IXunitTestCollection where TTestClass : class, IXunitTestClass where TTestCase : class, IXunitTestCase
Type Parameters
TContextTTestCollectionTTestClassTTestCase
- Inheritance
-
TestCollectionRunner<TContext, TTestCollection, TTestClass, TTestCase>XunitTestCollectionRunnerBase<TContext, TTestCollection, TTestClass, TTestCase>
- Derived
- Inherited Members
Methods
GetTestCaseOrderer(TContext)
Gives an opportunity to override test case orderer. By default, this method gets the
orderer from the collection definition. If this function returns null, the
test case orderer passed into the constructor will be used.
protected virtual ITestCaseOrderer? GetTestCaseOrderer(TContext ctxt)
Parameters
ctxtTContextThe context that describes the current test collection
Returns
OnTestCollectionFinished(TContext, RunSummary)
This method will be called when the test collection has finished running. By default this sends TestCollectionFinished. Override this to enable any extensibility related to test collection finish.
protected override ValueTask<bool> OnTestCollectionFinished(TContext ctxt, RunSummary summary)
Parameters
ctxtTContextThe context that describes the current test collection
summaryRunSummaryThe execution summary for the test collection
Returns
Remarks
This method runs during CleaningUp and any exceptions thrown will contribute to test collection cleanup failure.
OnTestCollectionStarting(TContext)
This method will be called before the test collection has started running. By default this sends TestCollectionStarting. Override this to enable any extensibility related to test collection start.
protected override ValueTask<bool> OnTestCollectionStarting(TContext ctxt)
Parameters
ctxtTContextThe context that describes the current test collection
Returns
Remarks
This method runs during Initializing and any exceptions thrown will contribute to test collection failure (and will prevent the test collection from running). Even if this method records exceptions, OnTestCollectionFinished(TContext, RunSummary) will be called.