Search Results for

    Show / Hide Table of Contents

    Class TestContext.TestAdapter

    TestAdapter adapts a Test for consumption by the user test code.

    Inheritance
    object
    TestContext.TestAdapter
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework
    Assembly: nunit.framework.dll
    Syntax
    public class TestContext.TestAdapter

    Constructors

    View Source

    TestAdapter(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 Source

    Arguments

    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[]
    View Source

    ClassName

    The ClassName of the test

    Declaration
    public string? ClassName { get; }
    Property Value
    Type Description
    string
    View Source

    DisplayName

    Get the display name of the test.

    Declaration
    public string? DisplayName { get; }
    Property Value
    Type Description
    string
    View Source

    ExpectedResult

    The expected result if there is one for the test

    Declaration
    public object? ExpectedResult { get; }
    Property Value
    Type Description
    object
    View Source

    FullName

    The FullName of the test

    Declaration
    public string FullName { get; }
    Property Value
    Type Description
    string
    View Source

    ID

    Gets the unique Id of a test

    Declaration
    public string ID { get; }
    Property Value
    Type Description
    string
    View Source

    Method

    The method representing the test.

    Declaration
    public IMethodInfo? Method { get; }
    Property Value
    Type Description
    IMethodInfo
    View Source

    MethodName

    The name of the method representing the test.

    Declaration
    public string? MethodName { get; }
    Property Value
    Type Description
    string
    View Source

    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
    View Source

    Namespace

    Get the Namespace of the test.

    Declaration
    public string? Namespace { get; }
    Property Value
    Type Description
    string
    View Source

    Parent

    The parent of this test or suite

    Declaration
    public ITest? Parent { get; }
    Property Value
    Type Description
    ITest
    View Source

    Properties

    A shallow copy of the properties of the test.

    Declaration
    public TestContext.PropertyBagAdapter Properties { get; }
    Property Value
    Type Description
    TestContext.PropertyBagAdapter
    View Source

    Type

    Gets the underlying Type.

    Declaration
    public Type? Type { get; }
    Property Value
    Type Description
    Type

    Methods

    View Source

    AllCategories()

    Return all categories in the hierarchy flattened

    Declaration
    public IEnumerable<string> AllCategories()
    Returns
    Type Description
    IEnumerable<string>
    View Source

    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>
    View Source

    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>
    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0