Class XunitTestAssemblyRunnerBaseContext<TTestAssembly, TTestCase>
public class XunitTestAssemblyRunnerBaseContext<TTestAssembly, TTestCase> : TestAssemblyRunnerContext<TTestAssembly, TTestCase>, IAsyncLifetime, IAsyncDisposable where TTestAssembly : class, IXunitTestAssembly where TTestCase : class, IXunitTestCase
Type Parameters
TTestAssemblyTTestCase
- Inheritance
-
TestAssemblyRunnerContext<TTestAssembly, TTestCase>XunitTestAssemblyRunnerBaseContext<TTestAssembly, TTestCase>
- Implements
- Derived
- Inherited Members
Constructors
XunitTestAssemblyRunnerBaseContext(TTestAssembly, IReadOnlyCollection<TTestCase>, IMessageSink, ITestFrameworkExecutionOptions, CancellationToken)
public XunitTestAssemblyRunnerBaseContext(TTestAssembly testAssembly, IReadOnlyCollection<TTestCase> testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions, CancellationToken cancellationToken)
Parameters
testAssemblyTTestAssemblyThe test assembly
testCasesIReadOnlyCollection<TTestCase>The test cases from the assembly
executionMessageSinkIMessageSinkThe message sink to send execution messages to
executionOptionsITestFrameworkExecutionOptionsThe options used during test execution
cancellationTokenCancellationTokenThe cancellation token used to cancel execution
Properties
AssemblyFixtureMappings
Gets the mapping manager for assembly-level fixtures.
public FixtureMappingManager AssemblyFixtureMappings { get; }
Property Value
AssemblyTestCaseOrderer
Gets the assembly-level test case orderer, if one is present.
public ITestCaseOrderer? AssemblyTestCaseOrderer { get; }
Property Value
AssemblyTestCollectionOrderer
Gets the assembly-level test collection orderer, if one is present.
public ITestCollectionOrderer? AssemblyTestCollectionOrderer { get; }
Property Value
DisableParallelization
Gets a flag which indicates whether the user has requested that parallelization be disabled.
public bool DisableParallelization { get; }
Property Value
ExplicitOption
Gets a flag which indicates how explicit tests should be handled.
public ExplicitOption ExplicitOption { get; }
Property Value
MaxParallelThreads
Gets the maximum number of threads to use when running tests in parallel. If this returns a positive integer, that is the maximum number of threads; if it returns -1, that indicates that unlimited threads should be allowed.
public int MaxParallelThreads { get; }
Property Value
ParallelAlgorithm
Gets the algorithm used for parallelism.
public ParallelAlgorithm ParallelAlgorithm { get; }
Property Value
TargetFramework
Gets the target framework that the test assembly is targeting. By default, this returns null.
Test frameworks that are based on .NET runtime assemblies can look for TargetFrameworkAttribute
decorated at the assembly level, which is added automatically by the compiler.
public override string TargetFramework { get; }
Property Value
TestAssembly
Gets the assembly that is being executed.
public TTestAssembly TestAssembly { get; }
Property Value
- TTestAssembly
TestEnvironment
Gets the environment that the test are running in. By default, returns a string which indicates process bitness, processor architecture (when known), and the description of the runtime environment (from FrameworkDescription).
public override string TestEnvironment { get; }
Property Value
Remarks
Example: "64-bit (x64) .NET 8.0.11"
Methods
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public override ValueTask DisposeAsync()
Returns
InitializeAsync()
Called immediately after the class has been created, before it is used.
public override ValueTask InitializeAsync()
Returns
RunTestCollection(IXunitTestCollection, IReadOnlyCollection<TTestCase>, ITestCaseOrderer)
Delegation of RunTestCollection(TContext, TTestCollection, IReadOnlyCollection<TTestCase>) that properly obeys the parallel algorithm requirements.
public ValueTask<RunSummary> RunTestCollection(IXunitTestCollection testCollection, IReadOnlyCollection<TTestCase> testCases, ITestCaseOrderer testCaseOrderer)
Parameters
testCollectionIXunitTestCollectiontestCasesIReadOnlyCollection<TTestCase>testCaseOrdererITestCaseOrderer
Returns
SetupParallelism()
Sets up the mechanics for parallelism.
public virtual void SetupParallelism()