Table of Contents

Method Find

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

Find(Func<ITestCase, ValueTask<bool>>, ITestFrameworkDiscoveryOptions, Type[]?, CancellationToken?)

Finds tests inside an assembly. Calls the callback for each discovered test.

public ValueTask Find(Func<ITestCase, ValueTask<bool>> callback, ITestFrameworkDiscoveryOptions discoveryOptions, Type[]? types = null, CancellationToken? cancellationToken = null)

Parameters

callback Func<ITestCase, ValueTask<bool>>

Called for each discovered test. Return true to continue test discovery; return false to cancel test discovery.

discoveryOptions

The options used by the test framework during discovery.

types Type[]

When passed a non-null collection, only returns tests found from one of the provided types; when passed a null collection, discovers all tests in the assembly.

cancellationToken CancellationToken?

The cancellation token which can be used to cancel the test discovery process.

Returns

ValueTask