Show / Hide Table of Contents

Namespace Xunit

Classes

AfterTestFinished

Default implementation of .

AfterTestStarting

Default implementation of .

AssemblyTraitAttribute

Attribute used to decorate an assembly with arbitrary name/value pairs ("traits").

Assert

Contains various static methods that are used to verify that conditions are met during the process of running tests.

Assert.RaisedEvent<T>

Represents a raised event after the fact.

BeforeTestFinished

Default implementation of .

BeforeTestStarting

Default implementation of .

ClassDataAttribute

Provides a data source for a data theory, with the data coming from a class which must implement IEnumerable<object[]>. Caution: the property is completely enumerated by .ToList() before any test is run. Hence it should return independent object sets.

CollectionAttribute

Used to declare a specific test collection for a test class.

CollectionBehaviorAttribute

Used to declare the default test collection behavior for the assembly.

CollectionDefinitionAttribute

Used to declare a test collection container class. The container class gives developers a place to attach interfaces like IClassFixture<TFixture> and ICollectionFixture<TFixture> that will be applied to all tests classes that are members of the test collection.

DiagnosticMessage

Default implementation of .

DiscoveryCompleteMessage

Default implementation of .

ErrorMessage

Default implementation of .

ExceptionUtility

Utility classes for dealing with Exception objects.

FactAttribute

Attribute that is applied to a method to indicate that it is a fact that should be run by the test runner. It can also be extended to support a customized definition of a test method.

InlineDataAttribute

Provides a data source for a data theory, with the data coming from inline values.

LongLivedMarshalByRefObject

Base class for all long-lived objects that may cross over an AppDomain.

MemberDataAttribute

Provides a data source for a data theory, with the data coming from one of the following sources:

  1. A static property
  2. A static field
  3. A static method (with parameters) The member must return something compatible with IEnumerable<object[]> with the test data. Caution: the property is completely enumerated by .ToList() before any test is run. Hence it should return independent object sets.

MemberDataAttributeBase

Provides a base class for attributes that will provide member data. The member data must return something compatible with . Caution: the property is completely enumerated by .ToList() before any test is run. Hence it should return independent object sets.

NullMessageSink

An implementation of and Xunit.IMessageSinkWithTypes that ignores all messages.

Record

Allows the user to record actions for a test.

SourceInformation

Default implementation of .

TeamCityDisplayNameFormatter

TestAssemblyCleanupFailure

Default implementation of TestAssemblyCleanupFailure.

TestAssemblyFinished

Default implementation of .

TestAssemblyMessage

Default implementation of and .

TestAssemblyStarting

Default implementation of .

TestCaseCleanupFailure

Default implementation of .

TestCaseDiscoveryMessage

Default implementation of .

TestCaseFinished

Default implementation of .

TestCaseMessage

Default implementation of .

TestCaseOrdererAttribute

Used to decorate an assembly, test collection, or test class to allow the use of a custom ITestCaseOrderer.

TestCaseStarting

Default implementation of .

TestClassCleanupFailure

Default implementation of .

TestClassConstructionFinished

Default implementation of .

TestClassConstructionStarting

Default implementation of .

TestClassDisposeFinished

Default implementation of .

TestClassDisposeStarting

Default implementation of .

TestClassFinished

Default implementation of .

TestClassMessage

Default implementation of .

TestClassStarting

Default implementation of .

TestCleanupFailure

Default implementation of .

TestCollectionCleanupFailure

Default implementation of .

TestCollectionFinished

Default implementation of .

TestCollectionMessage

Default implementation of .

TestCollectionOrdererAttribute

Used to decorate an assembly to allow the use of a custom Xunit.Sdk.ITestCollectionOrderer.

TestCollectionStarting

Default implementation of .

TestFailed

Default implementation of .

TestFinished

Default implementation of .

TestFrameworkAttribute

Used to decorate an assembly to allow the use of a custom Xunit.Sdk.ITestFramework.

TestMessage

Default implementation of .

TestMethodCleanupFailure

Default implementation of .

TestMethodFinished

Default implementation of .

TestMethodMessage

Default implementation of .

TestMethodStarting

Default implementation of .

TestOutput

Default implementation of .

TestPassed

Default implementation of .

TestResultMessage

Default implementation of .

TestSkipped

Default implementation of .

TestStarting

Default implementation of .

TheoryAttribute

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 derive from DataAttribute (notably, InlineDataAttribute and MemberDataAttribute).

TheoryData

Provides data for theories based on collection initialization syntax.

TheoryData<T>

Represents a set of data for a theory with a single parameter. Data can be added to the data set using the collection initializer syntax.

TheoryData<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>

Represents a set of data for a theory with 5 parameters. Data can be added to the data set using the collection initializer syntax.

TheoryData<T1, T2>

Represents a set of data for a theory with 2 parameters. Data can be added to the data set using the collection initializer syntax.

TheoryData<T1, T2, T3>

Represents a set of data for a theory with 3 parameters. Data can be added to the data set using the collection initializer syntax.

TheoryData<T1, T2, T3, T4>

Represents a set of data for a theory with 4 parameters. Data can be added to the data set using the collection initializer syntax.

TheoryData<T1, T2, T3, T4, T5>

Represents a set of data for a theory with 5 parameters. Data can be added to the data set using the collection initializer syntax.

TheoryData<T1, T2, T3, T4, T5, T6>

Represents a set of data for a theory with 5 parameters. Data can be added to the data set using the collection initializer syntax.

TheoryData<T1, T2, T3, T4, T5, T6, T7>

Represents a set of data for a theory with 5 parameters. Data can be added to the data set using the collection initializer syntax.

TheoryData<T1, T2, T3, T4, T5, T6, T7, T8>

Represents a set of data for a theory with 5 parameters. Data can be added to the data set using the collection initializer syntax.

TheoryData<T1, T2, T3, T4, T5, T6, T7, T8, T9>

Represents a set of data for a theory with 5 parameters. Data can be added to the data set using the collection initializer syntax.

TraitAttribute

Attribute used to decorate a test method with arbitrary name/value pairs ("traits").

Interfaces

IAsyncLifetime

Used to provide asynchronous lifetime functionality. Currently supported:

  • Test classes
  • Classes used in IClassFixture<TFixture>
  • Classes used in ICollectionFixture<TFixture>.

IClassFixture<TFixture>

Used to decorate xUnit.net test classes and collections to indicate a test which has per-test-class fixture data. An instance of the fixture data is initialized just before the first test in the class is run, and if it implements IDisposable, is disposed after the last test in the class is run. 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 TFixture. Class fixtures must have a single parameterless constructor, and may take collection fixture types as constructor arguments.

ICollectionFixture<TFixture>

Used to decorate xUnit.net test classes and collections to indicate a test which has per-test-collection fixture data. An instance of the fixture data is initialized just before the first test in the collection is run, and if it implements IDisposable, is disposed after the last test in the collection is run. 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 TFixture.

ITestCollectionOrderer

A class implements this interface to participate in ordering tests for the test runner. Test collection orderers are applied using the TestCollectionOrdererAttribute, which can be applied at the assembly level.

Enums

CollectionBehavior

Defines the built-in behavior types for collections in xUnit.net.

TestMethodDisplay

Indicates the default display name format for test methods.

TestMethodDisplayOptions

Indicates the method display options for test methods.

Back to top Generated by DocFX