Table of Contents

Interface ICanPerformGiven

Namespace
CSF.Screenplay.Actors
Assembly
CSF.Screenplay.Abstractions.dll

An actor which is able to perform in the Given phase of a IPerformance.

public interface ICanPerformGiven
Extension Methods

Remarks

This interface is conceptually identical to ICanPerform, except that the nomenclature of its methods is written in the past tense, as is best pratice for the Given phase of a performance.

Methods

WasAbleTo(IPerformable, CancellationToken)

Performs an action or task which returns no result.

ValueTask WasAbleTo(IPerformable performable, CancellationToken cancellationToken = default)

Parameters

performable IPerformable

The performable item

cancellationToken CancellationToken

An optional token to cancel the performable

Returns

ValueTask

A task which completes when the performable is complete

WasAbleTo(IPerformableWithResult, CancellationToken)

Performs an action or task which returns an untyped result.

ValueTask<object> WasAbleTo(IPerformableWithResult performable, CancellationToken cancellationToken = default)

Parameters

performable IPerformableWithResult

The performable item

cancellationToken CancellationToken

An optional token to cancel the performable

Returns

ValueTask<object>

A task which exposes a result when the performable is complete

WasAbleTo<T>(IPerformableWithResult<T>, CancellationToken)

Performs an action or task which returns a strongly typed result.

ValueTask<T> WasAbleTo<T>(IPerformableWithResult<T> performable, CancellationToken cancellationToken = default)

Parameters

performable IPerformableWithResult<T>

The performable item

cancellationToken CancellationToken

An optional token to cancel the performable

Returns

ValueTask<T>

A task which exposes a result when the performable is complete

Type Parameters

T

The result type

See Also