Namespace Xunit.v3
Classes
- AfterTestFinished
Default implementation of IAfterTestFinished.
- AfterTestStarting
Default implementation of IAfterTestStarting.
- BeforeAfterTestAttribute
Default implementation of IBeforeAfterTestAttribute.
- BeforeTestFinished
Default implementation of IBeforeTestFinished.
- BeforeTestStarting
Default implementation of IBeforeTestStarting.
- CollectionPerAssemblyTestCollectionFactory
Implementation of IXunitTestCollectionFactory that creates a single default test collection for the assembly, and places any tests classes which are not decorated by CollectionAttribute or CollectionAttribute<TCollectionDefinition> into the default test collection.
- CollectionPerClassTestCollectionFactory
Implementation of IXunitTestCollectionFactory which creates a new test collection for each test class that isn't decorated with CollectionAttribute or CollectionAttribute<TCollectionDefinition>.
- ContextBase
Base class for all execution pipeline context classes.
- DataAttribute
Abstract attribute which represents a based implementation of IDataAttribute. Data source providers derive from this attribute and implement GetData(MethodInfo, DisposalTracker) to return the data for the theory.
- DefaultTestCaseOrderer
Default implementation of ITestCaseOrderer. Orders tests in an unpredictable but stable order, so that repeated test runs of the identical test assembly run tests in the same order.
- DefaultTestCollectionOrderer
Default implementation of ITestCollectionOrderer. Orders tests in an unpredictable and unstable order, so that repeated test runs of the identical test assembly run test collections in a random order.
- DelegatingMessageBus
Implementation of IMessageBus that delegates to another implementation of IMessageBus while calling into an optional callback for each message.
- DelegatingMessageBus<TFinalMessage>
Implementation of IMessageBus that delegates to another implementation of IMessageBus while calling into an optional callback for each message. In addition, it issues a Finished event when a message of the type
TFinalMessageis seen and records the final message for later retrieval.
- DelegatingMessageSink
Implementation of IMessageSink that delegates to another implementation of IMessageSink while calling into an optional callback for each message.
- DelegatingMessageSink<TFinalMessage>
Implementation of IMessageSink that delegates to another implementation of IMessageSink while calling into an optional callback for each message. In addition, it issues a Finished event when a message of the type
TFinalMessageis seen and records the final message for later retrieval.
- DiagnosticMessage
Default implementation of IDiagnosticMessage.
- DiscoveryComplete
Default implementation of IDiscoveryComplete.
- DiscoveryStarting
Default implementation of IDiscoveryStarting.
- DisplayNameFormatter
Represents a formatter that formats the display name of a class and/or method into a more human readable form using additional options.
- DynamicSkipToken
Container class for token used to dynamically skip tests.
- ErrorMessage
Default implementation of IErrorMessage.
- ExecutionErrorTestCase
A simple implementation of IXunitTestCase that can be used to report an error rather than running a test.
- ExecutionTimer
The methods on this static class can measure the time taken to execute actions (both synchronous and asynchronous).
- ExtensibilityPointFactory
Represents a factory for the types used for extensibility throughout the system.
- FactDiscoverer
Implementation of IXunitTestCaseDiscoverer that supports finding test cases on methods decorated with FactAttribute.
- FixtureMappingManager
Maps fixture objects, including support for generic collection fixtures.
- InProcessFrontController
This class is a "philosophical" implementation of IFrontController (which isn't a type that's available here), intended to be used by in-process runners, wrapped around an implementation of ITestFramework. The signatures of the methods are slightly different, as they permit and require direct access to ITestCase instances rather than forcing the test cases through a round of serialization and deserialization. It will also manufacture the IDiscoveryStarting and IDiscoveryComplete messages that the test framework is not responsible for. When connected to remote meta-runners, the in-process runner can convert ITestCase instances into TestCaseDiscovered instances by using a converter like Xunit.Runner.Common.TestCaseExtensions.ToTestCaseDiscovered (which should be called from a callback passed to Find(IMessageSink?, ITestFrameworkDiscoveryOptions, Func<ITestCase, bool>, CancellationTokenSource, Type[]?, Func<ITestCase, bool, ValueTask<bool>>?)).
- InternalDiagnosticMessage
Default implementation of IInternalDiagnosticMessage.
- MaxConcurrencySyncContext
An implementation of SynchronizationContext which runs work on custom threads rather than in the thread pool, and limits the number of in-flight actions.
- MemberDataAttributeBase
Provides a base class for attributes that will provide member data.
- MessageSinkMessage
Default implementation of IMessageSinkMessage, with serialization support.
- TestAssemblyCleanupFailure
Default implementation of ITestAssemblyCleanupFailure.
- TestAssemblyFinished
Default implementation of ITestAssemblyFinished.
- TestAssemblyMessage
Default implementation of ITestAssemblyMessage.
- TestAssemblyRunnerContext<TTestAssembly, TTestCase>
Base context class for TestAssemblyRunner<TContext, TTestAssembly, TTestCollection, TTestCase>.
- TestAssemblyRunner<TContext, TTestAssembly, TTestCollection, TTestCase>
A base class that provides default behavior when running tests in an assembly. It groups the tests by test collection, and then runs the individual test collections.
- TestAssemblyStarting
Default implementation of ITestAssemblyStarting.
- TestCaseCleanupFailure
Default implementation of ITestCaseCleanupFailure.
- TestCaseDiscovered
Default implementation of ITestCaseDiscovered.
- TestCaseFinished
Default implementation of ITestCaseFinished.
- TestCaseMessage
Default implementation of ITestCaseMessage.
- TestCaseRunnerBaseContext<TTestCase>
Base context class for TestCaseRunnerBase<TContext, TTestCase>.
- TestCaseRunnerBase<TContext, TTestCase>
A base class that provides default behavior when running test cases.
- TestCaseRunnerContext<TTestCase, TTest>
Base context class for TestCaseRunner<TContext, TTestCase, TTest>.
- TestCaseRunner<TContext, TTestCase, TTest>
A base class that provides default behavior when running test cases which are assumed to result in one or more tests (that implement ITest).
- TestCaseStarting
Default implementation of ITestCaseStarting.
- TestClassCleanupFailure
Default implementation of ITestClassCleanupFailure.
- TestClassComparer
An implementation of IEqualityComparer<T> for ITestClass. Compares the fully qualified names of the types.
- TestClassConstructionFinished
Default implementation of ITestClassConstructionFinished.
- TestClassConstructionStarting
Default implementation of ITestClassConstructionStarting.
- TestClassDisposeFinished
Default implementation of ITestClassDisposeFinished.
- TestClassDisposeStarting
Default implementation of ITestClassDisposeStarting.
- TestClassFinished
Default implementation of ITestClassFinished
- TestClassMessage
Default implementation of ITestClassMessage.
- TestClassRunnerContext<TTestClass, TTestCase>
Base context class for TestClassRunnerContext<TTestClass, TTestCase>.
- TestClassRunner<TContext, TTestClass, TTestMethod, TTestCase>
A base class that provides default behavior when running tests in a test class. It groups the tests by test method, and then runs the individual test methods.
- TestClassStarting
Default implementation of ITestClassStarting.
- TestCleanupFailure
Default implementation of ITestCleanupFailure.
- TestCollectionCleanupFailure
Default implementation of ITestCollectionCleanupFailure.
- TestCollectionComparer<TTestCollection>
An implementation of IEqualityComparer<T> for ITestCollection. Compares the IDs of the test collections.
- TestCollectionFactoryBase
Base class with common functionality between CollectionPerAssemblyTestCollectionFactory and CollectionPerClassTestCollectionFactory.
- TestCollectionFinished
Default implementation of ITestCollectionFinished.
- TestCollectionMessage
Default implementation of ITestCollectionMessage.
- TestCollectionRunnerContext<TTestCollection, TTestCase>
Base context class for TestCollectionRunner<TContext, TTestCollection, TTestClass, TTestCase>.
- TestCollectionRunner<TContext, TTestCollection, TTestClass, TTestCase>
A base class that provides default behavior when running tests in a test collection. It groups the tests by test class, and then runs the individual test classes.
- TestCollectionStarting
Default implementation of ITestCollectionStarting.
- TestContextAccessor
Default implementation of ITestContextAccessor.
- TestFailed
Default implementation of ITestFailed.
- TestFinished
Default implementation of ITestFinished.
- TestFramework
A default implementation of ITestFramework that tracks objects to be disposed when the framework is disposed. The discoverer and executor are automatically tracked for disposal, since those interfaces mandate an implementation of IDisposable.
- TestFrameworkDiscoverer<TTestClass>
A base implementation of ITestFrameworkDiscoverer that supports test filtering and runs the discovery process on a thread pool thread.
- TestFrameworkExecutor<TTestCase>
A reusable implementation of ITestFrameworkExecutor which contains the basic behavior for running tests.
- TestIntrospectionHelper
Helper functions for retrieving and interpreting test and test case details from various sources (like IFactAttribute, IDataAttribute, and others).
- TestMessage
Default implementation of ITestMessage.
- TestMethodCleanupFailure
Default implementation of ITestMethodCleanupFailure.
- TestMethodComparer
An implementation of IEqualityComparer<T> for ITestMethod. Compares the names of the methods.
- TestMethodFinished
Default implementation of ITestMethodFinished.
- TestMethodMessage
Default implementation of ITestMethodMessage.
- TestMethodRunnerContext<TTestMethod, TTestCase>
Base context class for TestMethodRunner<TContext, TTestMethod, TTestCase>.
- TestMethodRunner<TContext, TTestMethod, TTestCase>
A base class that provides default behavior when running tests in a test method.
- TestMethodStarting
Default implementation of ITestMethodStarting.
- TestNotRun
Default implementation of ITestNotRun.
- TestOutput
Default implementation of ITestOutput.
- TestOutputHelper
Default implementation of ITestOutputHelper.
- TestPassed
Default implementation of ITestPassed.
- TestPipelineStartupAttribute
Used to decorate xUnit.net test assemblies to indicate that the developer wishes to have code that runs during the test pipeline startup and shutdown (including both discovery and execution).
- TestResultMessage
Default implementation of ITestResultMessage.
- TestRunnerBaseContext<TTest>
Base context class for TestRunnerBase<TContext, TTest>.
- TestRunnerBase<TContext, TTest>
A base class that provides default behavior when running a test. This includes support for skipping tests.
- TestRunnerContext<TTest>
Base context class for TestRunner<TContext, TTest>. This includes an assumption that a test means invoking a method on a class.
- TestRunner<TContext, TTest>
A base class that provides default behavior when running a test. This includes support for skipping tests.
- TestSkipped
Default implementation of ITestSkipped.
- TestStarting
Default implementation of ITestStarting.
- TheoryDiscoverer
Implementation of IXunitTestCaseDiscoverer that supports finding test cases on methods decorated with ITheoryAttribute.
- XunitDelayEnumeratedTheoryTestCase
Represents a test case which runs multiple tests for theory data, either because theory data pre-enumeration was disabled or because the data was not serializable.
- XunitRunnerHelper
Helper functions for xUnit.net v3 runners.
- XunitTestAssembly
The default implementation of IXunitTestAssembly for xUnit.net v3.
- XunitTestAssemblyRunner
The test assembly runner for xUnit.net v3 tests.
- XunitTestAssemblyRunnerBaseContext<TTestAssembly, TTestCase>
Context class for XunitTestAssemblyRunnerBase<TContext, TTestAssembly, TTestCollection, TTestCase>.
- XunitTestAssemblyRunnerBase<TContext, TTestAssembly, TTestCollection, TTestCase>
The test assembly runner for xUnit.net v3 tests (with overridable context).
- XunitTestAssemblyRunnerContext
Context class for XunitTestAssemblyRunner.
- XunitTestCase
Default implementation of IXunitTestCase for xUnit.net v3 that supports test methods decorated with FactAttribute. Test methods decorated with derived attributes may use this as a base class to build from.
- XunitTestCaseDiscovererAttribute
An attribute used to decorate classes which implement IFactAttribute, to indicate how test cases should be discovered.
- XunitTestCaseRunner
The test case runner for xUnit.net v3 tests.
- XunitTestCaseRunnerBaseContext<TTestCase, TTest>
Context class for XunitTestCaseRunnerBase<TContext, TTestCase, TTest>.
- XunitTestCaseRunnerBase<TContext, TTestCase, TTest>
The test case runner for xUnit.net v3 tests (with overridable context).
- XunitTestCaseRunnerContext
Context class for XunitTestCaseRunner.
- XunitTestClass
Default implementation of IXunitTestClass for xUnit v3 tests based on reflection.
- XunitTestClassRunner
The test class runner for xUnit.net v3 tests.
- XunitTestClassRunnerBaseContext<TTestClass, TTestCase>
Context class for XunitTestClassRunnerBase<TContext, TTestClass, TTestMethod, TTestCase>.
- XunitTestClassRunnerBase<TContext, TTestClass, TTestMethod, TTestCase>
The test class runner for xUnit.net v3 tests (with overridable context).
- XunitTestClassRunnerContext
Context class for XunitTestClassRunner.
- XunitTestCollection
The default implementation of IXunitTestCollection for xUnit.net v3.
- XunitTestCollectionRunner
The test collection runner for xUnit.net v3 tests.
- XunitTestCollectionRunnerBaseContext<TTestCollection, TTestCase>
Context class for XunitTestCollectionRunnerBaseContext<TTestCollection, TTestCase>.
- XunitTestCollectionRunnerBase<TContext, TTestCollection, TTestClass, TTestCase>
The test collection runner for xUnit.net v3 tests (with overridable context).
- XunitTestCollectionRunnerContext
Context class for XunitTestCollectionRunner.
- XunitTestFramework
The implementation of ITestFramework that supports discovery and execution of unit tests linked against xunit.v3.core.dll.
- XunitTestFrameworkDiscoverer
The implementation of ITestFrameworkDiscoverer that supports discovery of unit tests linked against xunit.v3.core.dll.
- XunitTestFrameworkExecutor
The implementation of ITestFrameworkExecutor that supports execution of unit tests linked against xunit.v3.core.dll.
- XunitTestMethod
The default implementation of IXunitTestMethod for xUnit.net v3 based on MethodInfo.
- XunitTestMethodRunner
The test method runner for xUnit.net v3 tests.
- XunitTestMethodRunnerBaseContext<TTestMethod, TTestCase>
Context class for XunitTestMethodRunnerBase<TContext, TTestMethod, TTestCase>.
- XunitTestMethodRunnerBase<TContext, TTestMethod, TTestCase>
The base test method runner for xUnit.net v3 tests (with overridable context).
- XunitTestMethodRunnerContext
Context class for XunitTestMethodRunner.
- XunitTestRunner
The test runner for xUnit.net v3 tests.
- XunitTestRunnerBaseContext<TTest>
Context class for XunitTestRunner.
- XunitTestRunnerBase<TContext, TTest>
The base test runner for xUnit.net v3 tests (with overridable context).
- XunitTestRunnerContext
Context class for XunitTestRunner.
Structs
- ExceptionAggregator
Aggregates exceptions. Intended to run one or more code blocks, and collect the exceptions thrown by those code blocks.
- RunSummary
Represents the statistical summary from a run of one or more tests.
Interfaces
- IAssemblyFixtureAttribute
Used to decorate xUnit.net test assemblies to indicate per-assembly fixture data. An instance of the fixture data is initialized before any test in the assembly are run (including InitializeAsync() if it's implemented). After all the tests in the assembly have been run, it is cleaned up by calling DisposeAsync() if it's implemented, or it falls back to Dispose() if that's implemented. Assembly fixtures must have a public parameterless constructor. To gain access to the fixture data from inside the test, a constructor argument should be added to the test class which exactly matches the fixture type.
- IBeforeAfterTestAttribute
Indicates an attribute which is involved in test method interception (allows code to be run before and after a test is run).
- ICollectionAttribute
Used to declare a specific test collection for a test class. Only valid on test classes, and only a single instance of a collection attribute may be present.
- ICollectionBehaviorAttribute
Used to declare the default test collection behavior for the assembly. This is only valid at the assembly level, and there can be only one.
- IDataAttribute
Base interface that all data attributes (that is, data providers for theories) are expected to implement. Data attributes are valid on methods only.
- IFactAttribute
Attribute that is applied to a method to indicate that it is a test method that should be run by the default test runner. Implementations must be decorated by XunitTestCaseDiscovererAttribute to indicate which class is responsible for converting the test method into one or more tests.
- IMessageBus
Used by discovery, execution, and extensibility code to send messages to the runner.
- ISelfExecutingXunitTestCase
Represents an implementation of IXunitTestCase that is self-executing. This allows the test case to opt into the middle of the test execution pipeline without implementing everything that comes before it.
- ITestCaseOrderer
A class implements this interface to participate in ordering tests for the test runner. Test case orderers are applied using an implementation of ITestCaseOrdererAttribute (most commonly TestCaseOrdererAttribute), which can be applied at the assembly, test collection, and test class level.
- ITestCaseOrdererAttribute
Used to decorate an assembly, test collection, or test class to allow the use of a custom test case orderer. Only one may exist on a given element.
- ITestCollectionOrderer
A class implements this interface to participate in ordering tests for the test runner. Test collection orderers are applied using the and implementation of ITestCollectionOrdererAttribute (most commonly TestCollectionOrdererAttribute), which can be applied at the assembly level.
- ITestCollectionOrdererAttribute
Used to decorate an assembly, test collection, or test class to allow the use of a custom test collection orderer. Only one may exist on a given element.
- ITestFramework
Represents a test framework. There are two pieces to test frameworks: discovery and execution. The two factory methods represent these two pieces. Test frameworks may optionally implement either IDisposable or IAsyncDisposable. They may implement a constructor which is either empty, or takes a single IMessageSink for diagnostic messages, or takes two instances of IMessageSink for diagnostic messages and internal diagnostic messages, respectively.
- ITestFrameworkAttribute
Used to decorate an assembly to allow the use of a custom test framework. May only be placed at the assembly level, and only a single test framework is allowed.
- ITestFrameworkDiscoverer
Represents an implementation of the discovery part of a test framework. Implementations may optionally implement IDisposable and/or IAsyncDisposable for cleanup operations.
- ITestFrameworkExecutor
Represents an implementation of the execution part of a test framework. Implementations may optionally implement IDisposable and/or IAsyncDisposable for cleanup operations.
- ITestPipelineStartup
Interface implemented by developers who want to run code during test pipeline startup and shutdown. A single instance of this may be decorated with an instance of ITestPipelineStartupAttribute (typically TestPipelineStartupAttribute) at the assembly level.
- ITestPipelineStartupAttribute
Used to decorate xUnit.net test assemblies to indicate that the developer wishes to have code that runs during the test pipeline startup and shutdown (including both discovery and execution).
- ITestTimeoutException
This is a marker interface implemented to indicate that the exception is the result of a test timeout, resulting in a failure cause of Timeout.
- ITheoryAttribute
Marks a test method as being a data theory. Data theories are tests which are fed various bits of data from a data source, mapping to parameters on the test method. If the data source contains multiple rows, then the test method is executed multiple times (once with each data row). Data is provided by attributes which implement IDataAttribute (most commonly, InlineDataAttribute and MemberDataAttribute). Implementations must be decorated by XunitTestCaseDiscovererAttribute to indicate which class is responsible for converting the test method into one or more tests.
- ITraitAttribute
Base interface that all traits attributes (that is, anything with provides traits to a test). Trait attributes are valid on assemblies, classes, and methods.
- IXunitDelayEnumeratedTestCase
Indicates a test case which delays enumeration of tests until execution time.
- IXunitTest
Represents a test from xUnit.net v3 based on reflection.
- IXunitTestAssembly
Represents a test assembly from xUnit.net v3 based on reflection.
- IXunitTestCase
Represents a single test case from xUnit.net v3 based on reflection.
- IXunitTestCaseDiscoverer
Interface to be implemented by classes which are used to discover tests cases attached to test methods that are attributed with an implementation of IFactAttribute.
- IXunitTestClass
Represents a test class from xUnit.net v3 based on reflection.
- IXunitTestCollection
Represents a test collection from xUnit.net v3 based on reflection.
- IXunitTestCollectionFactory
This interface is intended to be implemented by components which generate test collections. End users specify the desired test collection factory by applying CollectionBehaviorAttribute (or any attribute that implements ICollectionBehaviorAttribute) at the assembly level. Classes which implement this interface must have a constructor that takes IXunitTestAssembly.
- IXunitTestMethod
Represents a test class from xUnit.net v3 based on reflection.