Table of Contents

Method Run

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

Run(IXunitTest, IMessageBus, object?[], ExplicitOption, ExceptionAggregator, CancellationTokenSource, IReadOnlyCollection<IBeforeAfterTestAttribute>)

Runs the test.

public ValueTask<RunSummary> Run(IXunitTest test, IMessageBus messageBus, object?[] constructorArguments, ExplicitOption explicitOption, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource, IReadOnlyCollection<IBeforeAfterTestAttribute> beforeAfterAttributes)

Parameters

test

The test that this invocation belongs to.

messageBus

The message bus to report run status to.

constructorArguments object[]

The arguments to be passed to the test class constructor.

explicitOption

A flag to indicate how explicit tests should be treated.

aggregator

The exception aggregator used to run code and collect exceptions.

cancellationTokenSource CancellationTokenSource

The task cancellation token source, used to cancel the test run.

beforeAfterAttributes IReadOnlyCollection<IBeforeAfterTestAttribute>

The list of IBeforeAfterTestAttributes for this test.

Returns

ValueTask<RunSummary>

Returns summary information about the test that was run.