Table of Contents

Class TestFrameworkExecutor<TTestCase>

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

A reusable implementation of ITestFrameworkExecutor which contains the basic behavior for running tests.

public abstract class TestFrameworkExecutor<TTestCase> : ITestFrameworkExecutor, IAsyncDisposable where TTestCase : ITestCase

Type Parameters

TTestCase

The type of the test case used by the test framework. Must derive from ITestCase.

Inheritance
TestFrameworkExecutor<TTestCase>
Implements
Derived
Inherited Members

Constructors

TestFrameworkExecutor(ITestAssembly)

A reusable implementation of ITestFrameworkExecutor which contains the basic behavior for running tests.

protected TestFrameworkExecutor(ITestAssembly testAssembly)

Parameters

testAssembly ITestAssembly

The test assembly.

Properties

DisposalTracker

Gets the disposal tracker for the test framework discoverer.

protected DisposalTracker DisposalTracker { get; }

Property Value

DisposalTracker

TestAssembly

Gets the test assembly for execution.

protected ITestAssembly TestAssembly { get; }

Property Value

ITestAssembly

Methods

CreateDiscoverer()

Override to create a test framework discoverer that can be used to discover tests when the user asks to run all test.

protected abstract ITestFrameworkDiscoverer CreateDiscoverer()

Returns

ITestFrameworkDiscoverer

The test framework discoverer

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public virtual ValueTask DisposeAsync()

Returns

ValueTask

RunTestCases(IReadOnlyCollection<TTestCase>, IMessageSink, ITestFrameworkExecutionOptions, CancellationToken)

Runs selected test cases in the assembly.

public abstract ValueTask RunTestCases(IReadOnlyCollection<TTestCase> testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions, CancellationToken cancellationToken)

Parameters

testCases IReadOnlyCollection<TTestCase>

The test cases to run.

executionMessageSink IMessageSink

The message sink to report results back to.

executionOptions ITestFrameworkExecutionOptions

The options to be used during test execution.

cancellationToken CancellationToken

The cancellation token which can be used to cancel the test execution process.

Returns

ValueTask