Interface ITest
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.
Namespace: NUnit.Framework.Interfaces
Assembly: nunit.framework.dll
Syntax
public interface ITest : IXmlNodeBuilder
Properties
View SourceArguments
The arguments to use in creating the test or empty array if none are required.
Declaration
object?[] Arguments { get; }
Property Value
Type | Description |
---|---|
object[] |
ClassName
Gets the name of the class containing this test. Returns null if the test is not associated with a class.
Declaration
string? ClassName { get; }
Property Value
Type | Description |
---|---|
string |
Fixture
Gets a fixture object for running this test.
Declaration
object? Fixture { get; }
Property Value
Type | Description |
---|---|
object |
FullName
Gets the fully qualified name of the test
Declaration
string FullName { get; }
Property Value
Type | Description |
---|---|
string |
HasChildren
Gets a bool indicating whether the current test has any descendant tests.
Declaration
bool HasChildren { get; }
Property Value
Type | Description |
---|---|
bool |
Id
Gets the id of the test
Declaration
string Id { get; }
Property Value
Type | Description |
---|---|
string |
IsSuite
Returns true if this is a test suite
Declaration
bool IsSuite { get; }
Property Value
Type | Description |
---|---|
bool |
Method
Gets the method which declares the test, or null if no method is associated with this test.
Declaration
IMethodInfo? Method { get; }
Property Value
Type | Description |
---|---|
IMethodInfo |
MethodName
Gets the name of the method implementing this test. Returns null if the test is not implemented as a method.
Declaration
string? MethodName { get; }
Property Value
Type | Description |
---|---|
string |
Name
Gets the name of the test
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
Parent
Gets the parent test, if any.
Declaration
ITest? Parent { get; }
Property Value
Type | Description |
---|---|
ITest | The parent test or null if none exists. |
Properties
Gets the properties of the test
Declaration
IPropertyBag Properties { get; }
Property Value
Type | Description |
---|---|
IPropertyBag |
RunState
Gets the RunState of the test, indicating whether it can be run.
Declaration
RunState RunState { get; }
Property Value
Type | Description |
---|---|
RunState |
TestCaseCount
Count of the test cases ( 1 if this is a test case )
Declaration
int TestCaseCount { get; }
Property Value
Type | Description |
---|---|
int |
TestType
Gets the type of the test
Declaration
string TestType { get; }
Property Value
Type | Description |
---|---|
string |
Tests
Gets this test's child tests
Declaration
IList<ITest> Tests { get; }
Property Value
Type | Description |
---|---|
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.
Declaration
ITypeInfo? TypeInfo { get; }
Property Value
Type | Description |
---|---|
ITypeInfo |