Class BeforeAndAfterTestCommand
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
TestCommandThe inner command.
Fields
AfterTest
Perform the after test action
protected Action<TestExecutionContext>? AfterTest
Field Value
BeforeTest
Perform the before test action
protected Action<TestExecutionContext>? BeforeTest
Field Value
Methods
Execute(TestExecutionContext)
Runs the test, saving a TestResult in the supplied TestExecutionContext.
public override TestResult Execute(TestExecutionContext context)
Parameters
context
TestExecutionContextThe context in which the test should run.
Returns
- TestResult
A TestResult