Class FactDiscoverer
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
discoveryOptionsITestFrameworkDiscoveryOptionsThe discovery options to be used.
testMethodIXunitTestMethodThe test method.
factAttributeIFactAttributeThe attribute that decorates the test method.
Returns
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
discoveryOptionsITestFrameworkDiscoveryOptionsThe discovery options to be used.
testMethodIXunitTestMethodThe test method the test cases belong to.
factAttributeIFactAttributeThe fact attribute attached to the test method.
Returns
- ValueTask<IReadOnlyCollection<IXunitTestCase>>
Returns zero or more test cases represented by the test method.