Class ScenarioOutlineTerminal<TExample, T>
- Namespace
- TinyBDD
- Assembly
- TinyBDD.dll
Represents a terminal scenario outline that can be executed with examples.
public sealed class ScenarioOutlineTerminal<TExample, T>
Type Parameters
TExampleThe type of example data.
TThe value type in the chain.
- Inheritance
-
ScenarioOutlineTerminal<TExample, T>
- Inherited Members
Methods
And(string, Func<T, bool>)
Adds an And assertion without using example data.
public ScenarioOutlineTerminal<TExample, T> And(string title, Func<T, bool> predicate)
Parameters
Returns
- ScenarioOutlineTerminal<TExample, T>
This terminal chain for further chaining.
And(string, Func<T, TExample, bool>)
Adds an And assertion that uses example data.
public ScenarioOutlineTerminal<TExample, T> And(string title, Func<T, TExample, bool> predicate)
Parameters
titlestringThe step title.
predicateFunc<T, TExample, bool>A predicate that receives the current value and example data.
Returns
- ScenarioOutlineTerminal<TExample, T>
This terminal chain for further chaining.
AssertAllPassedAsync(CancellationToken)
Executes the scenario outline for all examples and asserts all passed.
public Task AssertAllPassedAsync(CancellationToken ct = default)
Parameters
ctCancellationTokenOptional cancellation token.
Returns
Exceptions
- AggregateException
Thrown when one or more examples failed.
But(string, Func<T, TExample, bool>)
Adds a But assertion that uses example data.
public ScenarioOutlineTerminal<TExample, T> But(string title, Func<T, TExample, bool> predicate)
Parameters
titlestringThe step title.
predicateFunc<T, TExample, bool>A predicate that receives the current value and example data.
Returns
- ScenarioOutlineTerminal<TExample, T>
This terminal chain for further chaining.
Examples(params TExample[])
Specifies the example data rows to execute the scenario with.
public ScenarioOutlineTerminal<TExample, T> Examples(params TExample[] examples)
Parameters
examplesTExample[]The example data values.
Returns
- ScenarioOutlineTerminal<TExample, T>
This terminal chain for execution.
RunAsync(CancellationToken)
Executes the scenario outline for all examples and returns the results.
public Task<ExamplesResult> RunAsync(CancellationToken ct = default)
Parameters
ctCancellationTokenOptional cancellation token.
Returns
- Task<ExamplesResult>
The aggregated results from all example executions.