Table of Contents

Enum FailureCause

Namespace
Xunit.Sdk
Assembly
xunit.v3.common.dll

Indicates the cause of the test failure.

public enum FailureCause

Fields

Assertion = 3

Indicates that the test failed because of an assertion failure (that is, an exception was thrown that implements an interface named IAssertionException, regardless of the namespace or source assembly of the interface). For built-in exceptions, IAssertionException serves this purpose, but this is generally found by convention rather than type to prevent 3rd party assertion libraries from needing to take an explicit references to xUnit.net binaries.

Exception = 2

Indicates that the test failed because it threw an unhandled exception.

Other = 1

Indicates that a test failed for some reason other than a typical execution failure (for example, if a test was skipped but the flag was given to fail all skipped tests, or the test passed with warnings but the flag was given to fail tests with warnings).

Timeout = 4

Indicates that the test failed because it exceeded the allowed time to run (typically specified via Timeout). This is indicated by an exception that is thrown which implements an interface named ITestTimeoutException, regardless of the namespace or source assembly of the interface. For fact attributes, ITestTimeoutException serves this purpose, but this is generally found by convention rather than type to prevent 3rd party libraries from needing to take an explicit reference to xUnit.net binaries.

Unknown = 0

Indicates the test failure cause is unknown.