Class PerformanceStarter
- Namespace
- CSF.Screenplay
- Assembly
- CSF.Screenplay.Abstractions.dll
Helper class for beginning the functionality of a Screenplay IPerformance from your own logic, using a fluent interface
public static class PerformanceStarter
- Inheritance
-
PerformanceStarter
- Inherited Members
Examples
Here is an example of the recommended technique for consuming this class' functionality.
using static CSF.Screenplay.ScreenplayStarter;
// ... then in your top-level performance logic:
await Given(joe).WasAbleTo(takeOutTheTrash);
Remarks
This class is a convenience to aid in the readability of top-level performance logic, providing a fluent entry-point into the performance methods. Each of the methods upon this class corresponds to a PerformancePhase within the overall performance. By using these methods, the actor is down-cast to the appropriate interface that is specific to that phase, which activates appropriate functionality of the fluent interface.
It is recommended to consume this functionality in your own logic via the using static
directive, so that you may
use the Given(Actor), When(Actor) & Then(Actor) methods stand-alone.
Do not use these methods in your own Performable implementations. Doing so would reduce their reusability; use these methods only in your top-level performance logic. Any performables which are executed by one of these three methods automatically inherits the performance phase from which its top-level performable was started.
Methods
Given(Actor)
Returns the actor instance, down-cast to ICanPerformGiven, activating the fluent interface for the Given phase of the performance.
public static ICanPerformGiven Given(Actor actor)
Parameters
actor
ActorThe actor.
Returns
Then(Actor)
Returns the actor instance, down-cast to ICanPerformThen, activating the fluent interface for the Then phase of the performance.
public static ICanPerformThen Then(Actor actor)
Parameters
actor
ActorThe actor.
Returns
When(Actor)
Returns the actor instance, down-cast to ICanPerformWhen, activating the fluent interface for the When phase of the performance.
public static ICanPerformWhen When(Actor actor)
Parameters
actor
ActorThe actor.