Table of Contents

Interface ITest

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

Common interface supported by all representations of a test. Only includes informational fields. The Run method is specifically excluded to allow for data-only representations of a test.

public interface ITest : IXmlNodeBuilder
Inherited Members

Properties

Arguments

The arguments to use in creating the test or empty array if none are required.

object?[] Arguments { get; }

Property Value

object[]

ClassName

Gets the name of the class containing this test. Returns null if the test is not associated with a class.

string? ClassName { get; }

Property Value

string

Fixture

Gets a fixture object for running this test.

object? Fixture { get; }

Property Value

object

FullName

Gets the fully qualified name of the test

string FullName { get; }

Property Value

string

HasChildren

Gets a bool indicating whether the current test has any descendant tests.

bool HasChildren { get; }

Property Value

bool

Id

Gets the id of the test

string Id { get; }

Property Value

string

IsSuite

Returns true if this is a test suite

bool IsSuite { get; }

Property Value

bool

Method

Gets the method which declares the test, or null if no method is associated with this test.

IMethodInfo? Method { get; }

Property Value

IMethodInfo

MethodName

Gets the name of the method implementing this test. Returns null if the test is not implemented as a method.

string? MethodName { get; }

Property Value

string

Name

Gets the name of the test

string Name { get; }

Property Value

string

Parent

Gets the parent test, if any.

ITest? Parent { get; }

Property Value

ITest

The parent test or null if none exists.

Properties

Gets the properties of the test

IPropertyBag Properties { get; }

Property Value

IPropertyBag

RunState

Gets the RunState of the test, indicating whether it can be run.

RunState RunState { get; }

Property Value

RunState

TestCaseCount

Count of the test cases ( 1 if this is a test case )

int TestCaseCount { get; }

Property Value

int

TestType

Gets the type of the test

string TestType { get; }

Property Value

string

Tests

Gets this test's child tests

IList<ITest> Tests { get; }

Property Value

IList<ITest>

A list of child tests

TypeInfo

Gets the Type of the test fixture, if applicable, or null if no fixture type is associated with this test.

ITypeInfo? TypeInfo { get; }

Property Value

ITypeInfo