Table of Contents

Class TestResultState

Namespace
Xunit
Assembly
xunit.v3.core.dll

Represents information about the current state of a test after it has run.

public class TestResultState
Inheritance
TestResultState
Inherited Members

Properties

ExceptionMessages

Gets the message(s) of the exception(s). This value is only available when Result is Failed.

ExceptionParentIndices

Gets the parent exception index(es) for the exception(s); a -1 indicates that the exception in question has no parent. This value is only available when Result is Failed.

ExceptionStackTraces

Gets the stack trace(s) of the exception(s). This value is only available when Result is Failed.

ExceptionTypes

Gets the fully-qualified type name(s) of the exception(s). This value is only available when Result is Failed.

ExecutionTime

Gets the amount of time the test ran, in seconds. The value may be 0 if no test code was run (for example, a statically skipped test). Note that the value may be a partial value because of further timing being done while cleaning up.

FailureCause

Gets a value which indicates what the cause of the test failure was. This value is only available when Result is Failed.

Result

Returns the result from the test run.

Methods

ForNotRun(decimal?)

Create a not run test result.

ForPassed(decimal?)

Create a passing test result.

ForSkipped(decimal?)

Create a skipped test result.

FromException(decimal, Exception?)

Creates an instance based on the presence or absence of an exception. If the exception is null, then it will be for Passed; otherwise, it will be for Failed;

FromTestResult(ITestResultMessage)

Creates an instance based on inspecting the type identity of the testResult instance.