Table of Contents

Struct FromContext

Namespace
TinyBDD
Assembly
TinyBDD.dll

Helper that allows starting Given chains against an explicit ScenarioContext, instead of relying on Current.

public readonly struct FromContext
Inherited Members

Constructors

FromContext(ScenarioContext)

Helper that allows starting Given chains against an explicit ScenarioContext, instead of relying on Current.

public FromContext(ScenarioContext ctx)

Parameters

ctx ScenarioContext

The scenario context to use for subsequent calls.

Methods

Given<T>(Func<CancellationToken, Task<T>>)

Starts a token-aware Given step with a default title and asynchronous setup.

public ScenarioChain<T> Given<T>(Func<CancellationToken, Task<T>> setup)

Parameters

setup Func<CancellationToken, Task<T>>

Asynchronous factory that observes a CancellationToken.

Returns

ScenarioChain<T>

A ScenarioChain<T> that can be continued with When/Then.

Type Parameters

T

The type produced by the setup function.

Given<T>(Func<T>)

Starts a Given step with a default title and synchronous setup.

public ScenarioChain<T> Given<T>(Func<T> setup)

Parameters

setup Func<T>

Synchronous factory for the initial value.

Returns

ScenarioChain<T>

A ScenarioChain<T> that can be continued with When/Then.

Type Parameters

T

The type produced by the setup function.

Given<T>(string, Func<CancellationToken, Task<T>>)

Starts a token-aware Given step with an explicit title and asynchronous setup.

public ScenarioChain<T> Given<T>(string title, Func<CancellationToken, Task<T>> setup)

Parameters

title string

Human-friendly step title.

setup Func<CancellationToken, Task<T>>

Asynchronous factory that observes a CancellationToken.

Returns

ScenarioChain<T>

A ScenarioChain<T> that can be continued with When/Then.

Type Parameters

T

The type produced by the setup function.

Given<T>(string, Func<T>)

Starts a Given step with an explicit title and synchronous setup.

public ScenarioChain<T> Given<T>(string title, Func<T> setup)

Parameters

title string

Human-friendly step title.

setup Func<T>

Synchronous factory for the initial value.

Returns

ScenarioChain<T>

A ScenarioChain<T> that can be continued with When/Then.

Type Parameters

T

The type produced by the setup function.