Interface ITestResult
The ITestResult interface represents the result of a test.
Namespace: NUnit.Framework.Interfaces
Assembly: nunit.framework.dll
Syntax
public interface ITestResult : IXmlNodeBuilder
Properties
View SourceAssertCount
Gets the number of asserts executed when running the test and all its children.
Declaration
int AssertCount { get; }
Property Value
Type | Description |
---|---|
int |
AssertionResults
Gets a list of AssertionResults associated with the test
Declaration
IList<AssertionResult> AssertionResults { get; }
Property Value
Type | Description |
---|---|
IList<AssertionResult> |
Children
Gets the collection of child results.
Declaration
IEnumerable<ITestResult> Children { get; }
Property Value
Type | Description |
---|---|
IEnumerable<ITestResult> |
Duration
Gets the elapsed time for running the test in seconds
Declaration
double Duration { get; }
Property Value
Type | Description |
---|---|
double |
EndTime
Gets or sets the time the test finished running.
Declaration
DateTime EndTime { get; }
Property Value
Type | Description |
---|---|
DateTime |
FailCount
Gets the number of test cases that failed when running the test and all its children.
Declaration
int FailCount { get; }
Property Value
Type | Description |
---|---|
int |
FullName
Gets the full name of the test result
Declaration
string FullName { get; }
Property Value
Type | Description |
---|---|
string |
HasChildren
Indicates whether this result has any child results. Accessing HasChildren should not force creation of the Children collection in classes implementing this interface.
Declaration
bool HasChildren { get; }
Property Value
Type | Description |
---|---|
bool |
InconclusiveCount
Gets the number of test cases that were inconclusive when running the test and all its children.
Declaration
int InconclusiveCount { get; }
Property Value
Type | Description |
---|---|
int |
Message
Gets the message associated with a test failure or with not running the test
Declaration
string Message { get; }
Property Value
Type | Description |
---|---|
string |
Name
Gets the name of the test result
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
Output
Gets any text output written to this result.
Declaration
string Output { get; }
Property Value
Type | Description |
---|---|
string |
PassCount
Gets the number of test cases that passed when running the test and all its children.
Declaration
int PassCount { get; }
Property Value
Type | Description |
---|---|
int |
ResultState
Gets the ResultState of the test result, which indicates the success or failure of the test.
Declaration
ResultState ResultState { get; }
Property Value
Type | Description |
---|---|
ResultState |
SkipCount
Gets the number of test cases that were skipped when running the test and all its children.
Declaration
int SkipCount { get; }
Property Value
Type | Description |
---|---|
int |
StackTrace
Gets any stack trace associated with an error or failure.
Declaration
string? StackTrace { get; }
Property Value
Type | Description |
---|---|
string |
StartTime
Gets or sets the time the test started running.
Declaration
DateTime StartTime { get; }
Property Value
Type | Description |
---|---|
DateTime |
Test
Gets the Test to which this result applies.
Declaration
ITest Test { get; }
Property Value
Type | Description |
---|---|
ITest |
TestAttachments
Gets the collection of files attached to the test
Declaration
ICollection<TestAttachment> TestAttachments { get; }
Property Value
Type | Description |
---|---|
ICollection<TestAttachment> |
TotalCount
Gets the total number of tests executed when running the test and all its children.
Declaration
int TotalCount { get; }
Property Value
Type | Description |
---|---|
int |
WarningCount
Gets the number of test cases that had warnings when running the test and all its children.
Declaration
int WarningCount { get; }
Property Value
Type | Description |
---|---|
int |