Performs an action as a new step within the current context and associates
it with the calling function. Verifies that the step produced the expected outcome.
Namespace:
Gallio.FrameworkAssembly: Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)
Syntax
| C# |
|---|
public static TestContext RunStepAndVerifyOutcome( string name, Action action, TestOutcome expectedOutcome ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function RunStepAndVerifyOutcome ( _ name As String, _ action As Action, _ expectedOutcome As TestOutcome _ ) As TestContext |
Parameters
- name
- Type: System..::.String
The name of the step.
- action
- Type: Gallio.Common..::.Action
The action to perform.
- expectedOutcome
- Type: Gallio.Model..::.TestOutcome
The expected outcome of the step.
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 verifies that the step produced the expected outcome. If a different outcome was obtained, then raises an assertion failure.
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentNullException | Thrown if name or action is null. |
| System..::.ArgumentException | Thrown if name is the empty string. |
| Gallio.Framework.Assertions..::.AssertionFailureException | Thrown if the expected outcome was not obtained. |
| System..::.InvalidOperationException | Thrown if there is no current test context. |
