Table of Contents

Class FactDiscoverer

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

Implementation of IXunitTestCaseDiscoverer that supports finding test cases on methods decorated with FactAttribute.

public class FactDiscoverer : IXunitTestCaseDiscoverer
Inheritance
FactDiscoverer
Implements
Inherited Members

Methods

CreateTestCase(ITestFrameworkDiscoveryOptions, IXunitTestMethod, IFactAttribute)

Creates a single XunitTestCase for the given test method.

protected virtual IXunitTestCase CreateTestCase(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, IFactAttribute factAttribute)

Parameters

discoveryOptions ITestFrameworkDiscoveryOptions

The discovery options to be used.

testMethod IXunitTestMethod

The test method.

factAttribute IFactAttribute

The attribute that decorates the test method.

Returns

IXunitTestCase

Discover(ITestFrameworkDiscoveryOptions, IXunitTestMethod, IFactAttribute)

Discover test cases from a test method. By default, if the method is generic, or it contains arguments, returns a single ExecutionErrorTestCase; otherwise, it returns the result of calling CreateTestCase(ITestFrameworkDiscoveryOptions, IXunitTestMethod, IFactAttribute).

public virtual ValueTask<IReadOnlyCollection<IXunitTestCase>> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, IFactAttribute factAttribute)

Parameters

discoveryOptions ITestFrameworkDiscoveryOptions

The discovery options to be used.

testMethod IXunitTestMethod

The test method the test cases belong to.

factAttribute IFactAttribute

The fact attribute attached to the test method.

Returns

ValueTask<IReadOnlyCollection<IXunitTestCase>>

Returns zero or more test cases represented by the test method.