Class TestContext.TestAdapter
TestAdapter adapts a Test for consumption by the user test code.
Inherited Members
Namespace: NUnit.Framework
Assembly: nunit.framework.dll
Syntax
public class TestContext.TestAdapter
Constructors
View SourceTestAdapter(Test)
Construct a TestAdapter for a Test
Declaration
public TestAdapter(Test test)
Parameters
Type | Name | Description |
---|---|---|
Test | test | The Test to be adapted |
Properties
View SourceArguments
The arguments to use in creating the test or empty array if none are required.
Declaration
public object?[] Arguments { get; }
Property Value
Type | Description |
---|---|
object[] |
ClassName
The ClassName of the test
Declaration
public string? ClassName { get; }
Property Value
Type | Description |
---|---|
string |
DisplayName
Get the display name of the test.
Declaration
public string? DisplayName { get; }
Property Value
Type | Description |
---|---|
string |
ExpectedResult
The expected result if there is one for the test
Declaration
public object? ExpectedResult { get; }
Property Value
Type | Description |
---|---|
object |
FullName
The FullName of the test
Declaration
public string FullName { get; }
Property Value
Type | Description |
---|---|
string |
ID
Gets the unique Id of a test
Declaration
public string ID { get; }
Property Value
Type | Description |
---|---|
string |
Method
The method representing the test.
Declaration
public IMethodInfo? Method { get; }
Property Value
Type | Description |
---|---|
IMethodInfo |
MethodName
The name of the method representing the test.
Declaration
public string? MethodName { get; }
Property Value
Type | Description |
---|---|
string |
Name
The name of the test, which may or may not be the same as the method name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
Namespace
Get the Namespace of the test.
Declaration
public string? Namespace { get; }
Property Value
Type | Description |
---|---|
string |
Parent
The parent of this test or suite
Declaration
public ITest? Parent { get; }
Property Value
Type | Description |
---|---|
ITest |
Properties
A shallow copy of the properties of the test.
Declaration
public TestContext.PropertyBagAdapter Properties { get; }
Property Value
Type | Description |
---|---|
TestContext.PropertyBagAdapter |
Type
Gets the underlying Type.
Declaration
public Type? Type { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
View SourceAllCategories()
Return all categories in the hierarchy flattened
Declaration
public IEnumerable<string> AllCategories()
Returns
Type | Description |
---|---|
IEnumerable<string> |
AllPropertyValues(string)
Returns all values of a given property, with no duplicates
Declaration
public IEnumerable<object> AllPropertyValues(string property)
Parameters
Type | Name | Description |
---|---|---|
string | property | Name of property |
Returns
Type | Description |
---|---|
IEnumerable<object> |
PropertyHierarchy()
Returns all properties in the hierarchy Utility method for getting all properties in the hierarchy, with their included name, level and values.
Declaration
public IDictionary<TestContext.PropertyHierachyItem, IList> PropertyHierarchy()
Returns
Type | Description |
---|---|
IDictionary<TestContext.PropertyHierachyItem, IList> |