Table of Contents

Class XunitTestCollectionRunnerBase<TContext, TTestCollection, TTestClass, TTestCase>

Namespace
Xunit.v3
Assembly
xunit.v3.core.dll

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

TContext
TTestCollection
TTestClass
TTestCase
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

ctxt TContext

The context that describes the current test collection

Returns

ITestCaseOrderer

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

ctxt TContext

The context that describes the current test collection

summary RunSummary

The execution summary for the test collection

Returns

ValueTask<bool>

Return true if test execution should continue; false if it should be shut down.

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

ctxt TContext

The context that describes the current test collection

Returns

ValueTask<bool>

Return true if test execution should continue; false if it should be shut down.

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.