Table of Contents

Class TestCommand

Namespace
NUnit.Framework.Internal.Commands
Assembly
nunit.framework.dll

TestCommand is the abstract base class for all test commands in the framework. A TestCommand represents a single stage in the execution of a test, e.g.: SetUp/TearDown, checking for Timeout, verifying the returned result from a method, etc.

TestCommands may decorate other test commands so that the execution of a lower-level command is nested within that of a higher level command. All nested commands are executed synchronously, as a single unit. Scheduling test execution on separate threads is handled at a higher level, using the task dispatcher.

public abstract class TestCommand
Inheritance
TestCommand
Derived
Inherited Members

Constructors

TestCommand(Test)

Construct a TestCommand for a test.

public TestCommand(Test test)

Parameters

test Test

The test to be executed

Properties

Test

Gets the test associated with this command.

public Test Test { get; }

Property Value

Test

Methods

Execute(TestExecutionContext)

Runs the test in a specified context, returning a TestResult.

public abstract TestResult Execute(TestExecutionContext context)

Parameters

context TestExecutionContext

The TestExecutionContext to be used for running the test.

Returns

TestResult

A TestResult