Search Results for

    Show / Hide Table of Contents

    Class NUnitTestAssemblyRunner

    Implementation of ITestAssemblyRunner

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

    Constructors

    View Source

    NUnitTestAssemblyRunner(ITestAssemblyBuilder)

    Initializes a new instance of the NUnitTestAssemblyRunner class.

    Declaration
    public NUnitTestAssemblyRunner(ITestAssemblyBuilder builder)
    Parameters
    Type Name Description
    ITestAssemblyBuilder builder

    The builder.

    Properties

    View Source

    DefaultLevelOfParallelism

    Gets the default level of parallel execution (worker threads)

    Declaration
    public static int DefaultLevelOfParallelism { get; }
    Property Value
    Type Description
    int
    View Source

    IsTestComplete

    Indicates whether a test run is complete

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

    IsTestLoaded

    Indicates whether a test is loaded

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

    IsTestRunning

    Indicates whether a test is running

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

    LoadedTest

    The tree of tests that was loaded by the builder

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

    Result

    The test result, if a run has completed

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

    Methods

    View Source

    CountTestCases(ITestFilter)

    Count Test Cases using a filter

    Declaration
    public 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
    public 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

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

    The assembly to load

    IDictionary<string, object> settings

    Dictionary of option settings for loading the assembly

    Returns
    Type Description
    ITest

    A Test Assembly containing all loaded tests

    View Source

    Load(string, IDictionary<string, object>)

    Loads the tests found in an Assembly

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

    File name or path of the assembly to load

    IDictionary<string, object> settings

    Dictionary of option settings for loading the assembly

    Returns
    Type Description
    ITest

    A Test Assembly containing all 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
    public ITestResult Run(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

    Returns
    Type Description
    ITestResult

    The test results from the run

    View Source

    RunAsync(ITestListener, ITestFilter)

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

    Declaration
    public 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

    Remarks

    RunAsync is a template method, calling various abstract and virtual methods to be overridden by derived classes.

    View Source

    StopRun(bool)

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

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

    If true, kill any tests that are currently running

    View Source

    WaitForCompletion(int)

    Wait for the ongoing run to complete.

    Declaration
    public 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

    WrapInNUnitCallContext(Action)

    This method is a no-op in .NET Standard builds.

    Declaration
    protected void WrapInNUnitCallContext(Action action)
    Parameters
    Type Name Description
    Action action
    View Source

    WrapInNUnitCallContext<T>(Func<T>)

    This method is a no-op in .NET Standard builds.

    Declaration
    protected T WrapInNUnitCallContext<T>(Func<T> function)
    Parameters
    Type Name Description
    Func<T> function
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Implements

    ITestAssemblyRunner
    • 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