Search Results for

    Show / Hide Table of Contents

    Interface ITestAssemblyRunner

    The ITestAssemblyRunner interface is implemented by classes that are able to execute a suite of tests loaded from an assembly.

    Namespace: NUnit.Framework.Api
    Assembly: nunit.framework.dll
    Syntax
    public interface ITestAssemblyRunner

    Properties

    View Source

    IsTestComplete

    Indicates whether a test run is complete

    Declaration
    bool IsTestComplete { get; }
    Property Value
    Type Description
    bool
    View Source

    IsTestLoaded

    Indicates whether a test has been loaded

    Declaration
    bool IsTestLoaded { get; }
    Property Value
    Type Description
    bool
    View Source

    IsTestRunning

    Indicates whether a test is currently running

    Declaration
    bool IsTestRunning { get; }
    Property Value
    Type Description
    bool
    View Source

    LoadedTest

    Gets the tree of loaded tests, or null if no tests have been loaded.

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

    Result

    Gets the tree of test results, if the test run is completed, otherwise null.

    Declaration
    ITestResult? Result { get; }
    Property Value
    Type Description
    ITestResult

    Methods

    View Source

    CountTestCases(ITestFilter)

    Count Test Cases using a filter

    Declaration
    int CountTestCases(ITestFilter filter)
    Parameters
    Type Name Description
    ITestFilter filter

    The filter to apply

    Returns
    Type Description
    int

    The number of test cases found

    View Source

    ExploreTests(ITestFilter)

    Explore the test cases using a filter

    Declaration
    ITest ExploreTests(ITestFilter filter)
    Parameters
    Type Name Description
    ITestFilter filter

    The filter to apply

    Returns
    Type Description
    ITest

    Test Assembly with test cases that matches the filter

    View Source

    Load(Assembly, IDictionary<string, object>)

    Loads the tests found in an Assembly, returning an indication of whether or not the load succeeded.

    Declaration
    ITest Load(Assembly assembly, IDictionary<string, object> settings)
    Parameters
    Type Name Description
    Assembly assembly

    The assembly to load

    IDictionary<string, object> settings

    Dictionary of options to use in loading the test

    Returns
    Type Description
    ITest

    An ITest representing the loaded tests

    View Source

    Load(string, IDictionary<string, object>)

    Loads the tests found in an Assembly, returning an indication of whether or not the load succeeded.

    Declaration
    ITest Load(string assemblyName, IDictionary<string, object> settings)
    Parameters
    Type Name Description
    string assemblyName

    File name of the assembly to load

    IDictionary<string, object> settings

    Dictionary of options to use in loading the test

    Returns
    Type Description
    ITest

    An ITest representing the loaded tests

    View Source

    Run(ITestListener, ITestFilter)

    Run selected tests and return a test result. The test is run synchronously, and the listener interface is notified as it progresses.

    Declaration
    ITestResult Run(ITestListener listener, ITestFilter filter)
    Parameters
    Type Name Description
    ITestListener listener

    Interface to receive ITestListener notifications.

    ITestFilter filter

    A test filter used to select tests to be run

    Returns
    Type Description
    ITestResult
    View Source

    RunAsync(ITestListener, ITestFilter)

    Run selected tests asynchronously, notifying the listener interface as it progresses.

    Declaration
    void RunAsync(ITestListener listener, ITestFilter filter)
    Parameters
    Type Name Description
    ITestListener listener

    Interface to receive EventListener notifications.

    ITestFilter filter

    A test filter used to select tests to be run

    View Source

    StopRun(bool)

    Signal any test run that is in process to stop. Return without error if no test is running.

    Declaration
    void StopRun(bool force)
    Parameters
    Type Name Description
    bool force

    If true, kill any test-running threads

    View Source

    WaitForCompletion(int)

    Wait for the ongoing run to complete.

    Declaration
    bool WaitForCompletion(int timeout)
    Parameters
    Type Name Description
    int timeout

    Time to wait in milliseconds

    Returns
    Type Description
    bool

    True if the run completed, otherwise false

    • 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