Table of Contents

Interface ITestAssemblyRunner

Namespace
NUnit.Framework.Api
Assembly
nunit.framework.dll

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

public interface ITestAssemblyRunner

Properties

IsTestComplete

Indicates whether a test run is complete

bool IsTestComplete { get; }

Property Value

bool

IsTestLoaded

Indicates whether a test has been loaded

bool IsTestLoaded { get; }

Property Value

bool

IsTestRunning

Indicates whether a test is currently running

bool IsTestRunning { get; }

Property Value

bool

LoadedTest

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

ITest? LoadedTest { get; }

Property Value

ITest

Result

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

ITestResult? Result { get; }

Property Value

ITestResult

Methods

CountTestCases(ITestFilter)

Count Test Cases using a filter

int CountTestCases(ITestFilter filter)

Parameters

filter ITestFilter

The filter to apply

Returns

int

The number of test cases found

ExploreTests(ITestFilter)

Explore the test cases using a filter

ITest ExploreTests(ITestFilter filter)

Parameters

filter ITestFilter

The filter to apply

Returns

ITest

Test Assembly with test cases that matches the filter

Load(Assembly, IDictionary<string, object>)

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

ITest Load(Assembly assembly, IDictionary<string, object> settings)

Parameters

assembly Assembly

The assembly to load

settings IDictionary<string, object>

Dictionary of options to use in loading the test

Returns

ITest

An ITest representing the loaded tests

Load(string, IDictionary<string, object>)

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

ITest Load(string assemblyName, IDictionary<string, object> settings)

Parameters

assemblyName string

File name of the assembly to load

settings IDictionary<string, object>

Dictionary of options to use in loading the test

Returns

ITest

An ITest representing the loaded tests

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.

ITestResult Run(ITestListener listener, ITestFilter filter)

Parameters

listener ITestListener

Interface to receive ITestListener notifications.

filter ITestFilter

A test filter used to select tests to be run

Returns

ITestResult

RunAsync(ITestListener, ITestFilter)

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

void RunAsync(ITestListener listener, ITestFilter filter)

Parameters

listener ITestListener

Interface to receive EventListener notifications.

filter ITestFilter

A test filter used to select tests to be run

StopRun(bool)

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

void StopRun(bool force)

Parameters

force bool

If true, kill any test-running threads

WaitForCompletion(int)

Wait for the ongoing run to complete.

bool WaitForCompletion(int timeout)

Parameters

timeout int

Time to wait in milliseconds

Returns

bool

True if the run completed, otherwise false