Table of Contents

Method Run

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

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

Runs the test case.

public ValueTask<RunSummary> Run(IXunitTestCase testCase, IReadOnlyCollection<IXunitTest> tests, IMessageBus messageBus, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource, string displayName, string? skipReason, ExplicitOption explicitOption, object?[] constructorArguments)

Parameters

testCase

The test case that this invocation belongs to.

tests IReadOnlyCollection<IXunitTest>

The tests for the test case.

messageBus

The message bus to report run status to.

aggregator

The exception aggregator used to run code and collect exceptions.

cancellationTokenSource CancellationTokenSource

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

displayName string

The display name of the test case.

skipReason string

The skip reason, if the test is to be skipped.

explicitOption

A flag to indicate how explicit tests should be treated.

constructorArguments object[]

The arguments to be passed to the test class constructor.

Returns

ValueTask<RunSummary>

Returns summary information about the test that was run.

Remarks

This entry point is used for both single-test (like FactAttribute and individual data rows for TheoryAttribute tests) and multi-test test cases (like TheoryAttribute when pre-enumeration is disable or the theory data was not serializable).