Class StageExtensions
- Namespace
- CSF.Screenplay
- Assembly
- CSF.Screenplay.Abstractions.dll
Extension methods for IStage.
public static class StageExtensions
- Inheritance
-
StageExtensions
- Inherited Members
Methods
Spotlight<TPersona>(IStage)
Places an actor matching the specified persona into the spotlight, making them 'the current actor' on this stage.
public static Actor Spotlight<TPersona>(this IStage stage) where TPersona : class, IPersona
Parameters
stage
IStageThe stage on which to spotlight the actor.
Returns
- Actor
The actor instance which was placed into the spotlight.
Type Parameters
TPersona
A concrete type of IPersona from which to get an actor.
Remarks
A maximum of one actor may be in the spotlight at any time, so if a different actor is already in the spotlight as this method is used, then they will be implicitly removed and replaced by the actor derived from the persona. The actor who is in the spotlight may be retrieved by calling GetSpotlitActor().
If actor indicated by the persona is already in the spotlight then this method will have no effect, the actor will remain in the spotlight.
When spotlighting a persona, the actor instance is retrieved from an ICast based upon that same persona. See GetActor(IPersona) for more information.
To remove an actor from the spotlight without replacing them, use TurnSpotlightOff().
This method is the recommended way of putting an actor based upon a persona in the spotlight, as it takes care of resolving the persona from dependency injection automatically.
Exceptions
- ArgumentNullException
If the actor is null.