Performs an action as a new step within the current context and associates it
with the specified code reference. Does not verify the outcome of the step.
Namespace:
Gallio.FrameworkAssembly: Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)
Syntax
| C# |
|---|
public TestContext RunStep( string name, Action action, Nullable<TimeSpan> timeout, bool isTestCase, ICodeElementInfo codeElement ) |
| Visual Basic (Declaration) |
|---|
Public Function RunStep ( _ name As String, _ action As Action, _ timeout As Nullable(Of TimeSpan), _ isTestCase As Boolean, _ codeElement As ICodeElementInfo _ ) As TestContext |
Parameters
- name
- Type: System..::.String
The name of the step.
- action
- Type: Gallio.Common..::.Action
The action to perform.
- timeout
- Type: System..::.Nullable<(Of <(TimeSpan>)>)
The step execution timeout, or null if none.
- isTestCase
- Type: System..::.Boolean
True if the step represents an independent test case.
- codeElement
- Type: Gallio.Common.Reflection..::.ICodeElementInfo
The associated code element, or null if none.
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, Nullable<(Of <(TimeSpan>)>), Boolean, ICodeElementInfo, TestOutcome) to ensure that the expected outcome was obtained.
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentNullException | Thrown if name or action is null. |
| System..::.ArgumentException | Thrown if name is the empty string. |
| System..::.ArgumentOutOfRangeException | Thrown if timeout is negative. |
