Class ResultState
- Namespace
- NUnit.Framework.Interfaces
- Assembly
- nunit.framework.dll
The ResultState class represents the outcome of running a test. It contains two pieces of information. The Status of the test is an enum indicating whether the test passed, failed, was skipped or was inconclusive. The Label provides a more detailed breakdown for use by client runners.
public class ResultState
- Inheritance
-
ResultState
- Inherited Members
Constructors
ResultState(TestStatus)
Initializes a new instance of the ResultState class.
public ResultState(TestStatus status)
Parameters
status
TestStatusThe TestStatus.
ResultState(TestStatus, FailureSite)
Initializes a new instance of the ResultState class.
public ResultState(TestStatus status, FailureSite site)
Parameters
status
TestStatusThe TestStatus.
site
FailureSiteThe stage at which the result was produced
ResultState(TestStatus, string)
Initializes a new instance of the ResultState class.
public ResultState(TestStatus status, string label)
Parameters
status
TestStatusThe TestStatus.
label
stringThe label.
ResultState(TestStatus, string, FailureSite)
Initializes a new instance of the ResultState class.
public ResultState(TestStatus status, string label, FailureSite site)
Parameters
status
TestStatusThe TestStatus.
label
stringThe label.
site
FailureSiteThe stage at which the result was produced
Fields
Cancelled
The test was cancelled by the user
public static readonly ResultState Cancelled
Field Value
ChildFailure
A suite failed because one or more child tests failed or had errors
public static readonly ResultState ChildFailure
Field Value
Error
The test encountered an unexpected exception
public static readonly ResultState Error
Field Value
Explicit
The test was skipped because it is explicit
public static readonly ResultState Explicit
Field Value
Failure
The test failed
public static readonly ResultState Failure
Field Value
Ignored
The test has been ignored.
public static readonly ResultState Ignored
Field Value
Inconclusive
The result is inconclusive
public static readonly ResultState Inconclusive
Field Value
NotRunnable
The test was not runnable.
public static readonly ResultState NotRunnable
Field Value
SetUpError
A suite had an unexpected exception in its OneTimeSetUp
public static readonly ResultState SetUpError
Field Value
SetUpFailure
A suite failed in its OneTimeSetUp
public static readonly ResultState SetUpFailure
Field Value
Skipped
The test has been skipped.
public static readonly ResultState Skipped
Field Value
Success
The test succeeded
public static readonly ResultState Success
Field Value
TearDownError
A suite had an unexpected exception in its OneTimeDown
public static readonly ResultState TearDownError
Field Value
Properties
Label
Gets the label under which this test result is categorized, if any.
public string Label { get; }
Property Value
Site
Gets the stage of test execution in which the failure or other result took place.
public FailureSite Site { get; }
Property Value
Status
Gets the TestStatus for the test.
public TestStatus Status { get; }
Property Value
- TestStatus
The status.
Methods
Equals(object)
Determines whether the specified object, is equal to this instance.
public override bool Equals(object obj)
Parameters
Returns
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
WithSite(FailureSite)
Get a new ResultState, which is the same as the current one but with the FailureSite set to the specified value.
public ResultState WithSite(FailureSite site)
Parameters
site
FailureSiteThe FailureSite to use
Returns
- ResultState
A new ResultState