Performs an action as a new step within the current context and associates it with the calling function. Does not verify the outcome of the step.

Namespace:  Gallio.Framework
Assembly:  Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public static TestContext RunStep(
	string name,
	Action action
)
Visual Basic (Declaration)
Public Shared Function RunStep ( _
	name As String, _
	action As Action _
) As TestContext

Parameters

name
Type: System..::.String
The name of the step.
action
Type: Gallio.Common..::.Action
The action to perform.

Return Value

The context of the step that ran.

Remarks

This method creates a new child context with a new nested TestStep, enters the child context, performs the action, then exits the child context.

This method may be called recursively to create nested steps or concurrently to create parallel steps.

This method does not verify that the test step completed successfully. Check the Outcome of the test step or call RunStepAndVerifyOutcome(String, Action, TestOutcome) to ensure that the expected outcome was obtained.

Exceptions

ExceptionCondition
System..::.ArgumentNullExceptionThrown if name or action is null.
System..::.ArgumentExceptionThrown if name is the empty string.
System..::.InvalidOperationExceptionThrown if there is no current test context.

See Also