Table of Contents

Interface ITestResult

Namespace
NUnit.Framework.Interfaces
Assembly
nunit.framework.dll

The ITestResult interface represents the result of a test.

public interface ITestResult : IXmlNodeBuilder
Inherited Members

Properties

AssertCount

Gets the number of asserts executed when running the test and all its children.

int AssertCount { get; }

Property Value

int

AssertionResults

Gets a list of AssertionResults associated with the test

IList<AssertionResult> AssertionResults { get; }

Property Value

IList<AssertionResult>

Children

Gets the collection of child results.

IEnumerable<ITestResult> Children { get; }

Property Value

IEnumerable<ITestResult>

Duration

Gets the elapsed time for running the test in seconds

double Duration { get; }

Property Value

double

EndTime

Gets or sets the time the test finished running.

DateTime EndTime { get; }

Property Value

DateTime

FailCount

Gets the number of test cases that failed when running the test and all its children.

int FailCount { get; }

Property Value

int

FullName

Gets the full name of the test result

string FullName { get; }

Property Value

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.

bool HasChildren { get; }

Property Value

bool

InconclusiveCount

Gets the number of test cases that were inconclusive when running the test and all its children.

int InconclusiveCount { get; }

Property Value

int

Message

Gets the message associated with a test failure or with not running the test

string Message { get; }

Property Value

string

Name

Gets the name of the test result

string Name { get; }

Property Value

string

Output

Gets any text output written to this result.

string Output { get; }

Property Value

string

PassCount

Gets the number of test cases that passed when running the test and all its children.

int PassCount { get; }

Property Value

int

ResultState

Gets the ResultState of the test result, which indicates the success or failure of the test.

ResultState ResultState { get; }

Property Value

ResultState

SkipCount

Gets the number of test cases that were skipped when running the test and all its children.

int SkipCount { get; }

Property Value

int

StackTrace

Gets any stack trace associated with an error or failure.

string? StackTrace { get; }

Property Value

string

StartTime

Gets or sets the time the test started running.

DateTime StartTime { get; }

Property Value

DateTime

Test

Gets the Test to which this result applies.

ITest Test { get; }

Property Value

ITest

TestAttachments

Gets the collection of files attached to the test

ICollection<TestAttachment> TestAttachments { get; }

Property Value

ICollection<TestAttachment>

TotalCount

Gets the total number of tests executed when running the test and all its children.

int TotalCount { get; }

Property Value

int

WarningCount

Gets the number of test cases that had warnings when running the test and all its children.

int WarningCount { get; }

Property Value

int