Table of Contents

Class TestRunnerBaseContext<TTest>

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

Base context class for TestRunnerBase<TContext, TTest>.

public class TestRunnerBaseContext<TTest> : ContextBase, IAsyncLifetime, IAsyncDisposable where TTest : class, ITest

Type Parameters

TTest
Inheritance
TestRunnerBaseContext<TTest>
Implements
Derived
Inherited Members

Constructors

TestRunnerBaseContext(TTest, IMessageBus, string?, ExplicitOption, ExceptionAggregator, CancellationTokenSource)

Base context class for TestRunnerBase<TContext, TTest>.

public TestRunnerBaseContext(TTest test, IMessageBus messageBus, string? skipReason, ExplicitOption explicitOption, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)

Parameters

test TTest

The test

messageBus IMessageBus

The message bus to send execution messages to

skipReason string

The skip reason for the test, if it's being skipped

explicitOption ExplicitOption

The user's choice on how to treat explicit tests

aggregator ExceptionAggregator

The exception aggregator

cancellationTokenSource CancellationTokenSource

The cancellation token source

Properties

Test

Gets the test that's being invoked.

public TTest Test { get; }

Property Value

TTest

Methods

GetSkipReason(Exception?)

Gets the runtime skip reason for the test.

public virtual string? GetSkipReason(Exception? exception)

Parameters

exception Exception

The exception that was thrown during test invocation

Returns

string

The skip reason, if the test is skipped; null, otherwise