Table of Contents

Method FindAndRun

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

FindAndRun(IMessageSink, ITestFrameworkDiscoveryOptions, ITestFrameworkExecutionOptions, Func<ITestCase, bool>, Type[]?)

Starts the process of finding and running tests in an assembly. Typically only used by runner which do not present test discovery UIs to users that allow them to run selected tests (those should instead use Find(IMessageSink?, ITestFrameworkDiscoveryOptions, Func<ITestCase, bool>, Type[]?, Func<ITestCase, bool, ValueTask<bool>>?) and Run(IMessageSink, ITestFrameworkExecutionOptions, IReadOnlyCollection<ITestCase>) as separate operations).

public ValueTask FindAndRun(IMessageSink messageSink, ITestFrameworkDiscoveryOptions discoveryOptions, ITestFrameworkExecutionOptions executionOptions, Func<ITestCase, bool> filter, Type[]? types = null)

Parameters

messageSink

The message sink to report messages to.

discoveryOptions

The options to be used for discovery.

executionOptions

The options to be used for execution.

filter Func<ITestCase, bool>

The filter function for filtering test cases.

types Type[]

When passed a non-null collection, discovery/filtering/execution only looks for tests from one of the provided types; when passed a null collection, discovery/filtering/execution looks at all types in the assembly.

Returns

ValueTask