Table of Contents

Class XunitTestFrameworkDiscoverer

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

The implementation of ITestFrameworkDiscoverer that supports discovery of unit tests linked against xunit.v3.core.dll.

public class XunitTestFrameworkDiscoverer : TestFrameworkDiscoverer<IXunitTestClass>, ITestFrameworkDiscoverer, IAsyncDisposable
Inheritance
XunitTestFrameworkDiscoverer
Implements
Inherited Members
TestFrameworkDiscoverer<IXunitTestClass>.DisposalTracker
TestFrameworkDiscoverer<IXunitTestClass>.DisposeAsync()
TestFrameworkDiscoverer<IXunitTestClass>.IsValidTestClass(Type)

Constructors

XunitTestFrameworkDiscoverer(IXunitTestAssembly, IXunitTestCollectionFactory?)

Initializes a new instance of the XunitTestFrameworkDiscoverer class.

Properties

DiscovererTypeCache

Gets the mapping dictionary of fact attribute type to discoverer type. The key is a type that implements IFactAttribute; the value is the discoverer type, if known; null if not.

TestAssembly
TestCollectionFactory

Gets the test collection factory that makes test collections.

Methods

CreateTestClass(Type)

Implement this method to create a test class for the given CLR type.

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

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

FindTestsForMethod(IXunitTestMethod, ITestFrameworkDiscoveryOptions, Func<ITestCase, ValueTask<bool>>)

Finds the tests on a test method.

FindTestsForType(IXunitTestClass, ITestFrameworkDiscoveryOptions, Func<ITestCase, ValueTask<bool>>)

Core implementation to discover unit tests in a given test class.

GetDiscoverer(Type)

Gets the test case discover instance for the given discoverer type. The instances are cached and reused, since they should not be stateful.

GetExportedTypes()

Override this to provide a list of the exported types in the assembly.