Class TestFramework
A default implementation of ITestFramework that tracks objects to be disposed when the framework is disposed. The discoverer and executor are automatically tracked for disposal, since those interfaces mandate an implementation of IDisposable.
public abstract class TestFramework : ITestFramework, IAsyncDisposable
- Inheritance
-
TestFramework
- Implements
- Derived
- Inherited Members
Properties
DisposalTracker
Gets the disposal tracker for the test framework.
protected DisposalTracker DisposalTracker { get; }
Property Value
TestFrameworkDisplayName
Returns the display name of the test framework that this discoverer is running tests for.
public abstract string TestFrameworkDisplayName { get; }
Property Value
TestPipelineStartup
Gets the value that was set for the test pipeline startup, if one was present.
protected ITestPipelineStartup? TestPipelineStartup { get; }
Property Value
Methods
CreateDiscoverer(Assembly)
Override this method to provide the implementation of ITestFrameworkDiscoverer.
protected abstract ITestFrameworkDiscoverer CreateDiscoverer(Assembly assembly)
Parameters
assemblyAssemblyThe assembly that is being discovered.
Returns
- ITestFrameworkDiscoverer
Returns the test framework discoverer.
CreateExecutor(Assembly)
Override this method to provide the implementation of ITestFrameworkExecutor.
protected abstract ITestFrameworkExecutor CreateExecutor(Assembly assembly)
Parameters
assemblyAssemblyThe assembly that is being executed.
Returns
- ITestFrameworkExecutor
Returns the test framework executor.
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public virtual ValueTask DisposeAsync()
Returns
GetDiscoverer(Assembly)
Get a test discoverer.
public ITestFrameworkDiscoverer GetDiscoverer(Assembly assembly)
Parameters
assemblyAssemblyThe assembly to discover tests from.
Returns
- ITestFrameworkDiscoverer
The test discoverer.
GetExecutor(Assembly)
Get a test executor.
public ITestFrameworkExecutor GetExecutor(Assembly assembly)
Parameters
assemblyAssemblyThe assembly to run tests from.
Returns
- ITestFrameworkExecutor
The test executor.
SetTestPipelineStartup(ITestPipelineStartup)
Will be invoked by the test pipeline when the user has provided a startup class. Test frameworks may choose to use this in any way they see fit.
public void SetTestPipelineStartup(ITestPipelineStartup pipelineStartup)
Parameters
pipelineStartupITestPipelineStartup