Table of Contents

Class BeforeAndAfterTestCommand

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

TestActionCommand handles a single ITestAction applied to a test. It runs the BeforeTest method, then runs the test and finally runs the AfterTest method.

public abstract class BeforeAndAfterTestCommand : DelegatingTestCommand
Inheritance
BeforeAndAfterTestCommand
Derived
Inherited Members

Constructors

BeforeAndAfterTestCommand(TestCommand)

Initializes a new instance of the TestActionCommand class.

public BeforeAndAfterTestCommand(TestCommand innerCommand)

Parameters

innerCommand TestCommand

The inner command.

Fields

AfterTest

Perform the after test action

protected Action<TestExecutionContext>? AfterTest

Field Value

Action<TestExecutionContext>

BeforeTest

Perform the before test action

protected Action<TestExecutionContext>? BeforeTest

Field Value

Action<TestExecutionContext>

Methods

Execute(TestExecutionContext)

Runs the test, saving a TestResult in the supplied TestExecutionContext.

public override TestResult Execute(TestExecutionContext context)

Parameters

context TestExecutionContext

The context in which the test should run.

Returns

TestResult

A TestResult