Class PerformanceReportBuilder
- Namespace
- CSF.Screenplay.Reporting
- Assembly
- CSF.Screenplay.dll
Builder for an instance of PerformanceReport.
public class PerformanceReportBuilder
- Inheritance
-
PerformanceReportBuilder
- Inherited Members
Remarks
This is a stateful builder, so instances of this type are not reusable for more than one PerformanceReport.
Constructors
PerformanceReportBuilder(List<IdentifierAndNameModel>, IGetsValueFormatter, IFormatsReportFragment)
Initialises a new instance of PerformanceReportBuilder.
public PerformanceReportBuilder(List<IdentifierAndNameModel> namingHierarchy, IGetsValueFormatter valueFormatterProvider, IFormatsReportFragment formatter)
Parameters
namingHierarchy
List<IdentifierAndNameModel>The naming hierarchy of the performance; see NamingHierarchy
valueFormatterProvider
IGetsValueFormatterA value formatter factory
formatter
IFormatsReportFragmentA report-fragment formatter
Exceptions
- ArgumentNullException
If any parameter is null.
Methods
ActorCreated(Actor)
Adds a report to the current performance indicating that an actor has been created/added to the performance.
public void ActorCreated(Actor actor)
Parameters
actor
ActorThe actor
ActorGainedAbility(Actor, object)
Adds a report to the current performance indicating that an actor has gained/been granted a new ability.
public void ActorGainedAbility(Actor actor, object ability)
Parameters
ActorSpotlit(Actor)
Adds a report to the current performance indicating that an actor has been placed into the spotlight.
public void ActorSpotlit(Actor actor)
Parameters
actor
ActorThe actor
Remarks
For more information, see the spotlight glossary item.
BeginPerformable(object, Actor, string)
Begins a new report within the current performance, that a new performable has been begun.
public void BeginPerformable(object performable, Actor actor, string performancePhase)
Parameters
performable
objectThe performable obeject which has begun
actor
ActorThe actor executing the performable
performancePhase
stringThe performance phase in which the performable occurs
Remarks
This might be a new performable at the root of the performance, or it might be nested within another performable which is already in progress.
When this method is executed, the performable
becomes the 'current' performable for this
builder. The current performable is tracked as a Stack<T>, as a performable may contain a
hierarchy of further performables, each of which becomes the current performable in its turn. This method
pushes a new performable onto the stack. Once all of the consumed performables have finished, the current
performable will return to this one.
Thus, as performables begin and end, the current performable stack will be pushed and popped many times.
- See Also
EndPerformable(object, Actor)
Indicates that the current performable has finished normally and that it should no longer be current.
public void EndPerformable(object performable, Actor actor)
Parameters
performable
objectThe performable which is ending
actor
ActorThe actor which was executing the performable
Remarks
This method will 'pop' the current performable from the current performable stack. The current performable will become either the performable which directly consumed/composed the one which is ending, or perhaps this will lead to there being no current performable (if the ending performable was at the root of the performance).
- See Also
GetReport(bool?)
Records the outcome of this performance and gets the report.
public PerformanceReport GetReport(bool? success)
Parameters
success
bool?A value indicating the outcome of the performance, this has the same semantics as the parameter to FinishPerformance(bool?)
Returns
- PerformanceReport
The completed performance report.
Remarks
Use this method when the performance has completed. Once this method has been used, it is normal that this builder instance will not be used any further.
RecordAssetForCurrentPerformable(string, string)
Enriches the current performable with information about a file asset.
public void RecordAssetForCurrentPerformable(string assetPath, string assetSummary)
Parameters
assetPath
stringThe file path to the asset
assetSummary
stringThe human readable summary of the asset
Remarks
This method may be called many times for the same performable, or it might not be used at all.
RecordFailureForCurrentPerformable(Exception)
Records the current performable as a failure, due to an uncaught exception.
public void RecordFailureForCurrentPerformable(Exception exception)
Parameters
exception
ExceptionThe exception which lead to the failure
Remarks
This method will 'pop' the current performable from the current performable stack. The current performable will become either the performable which directly consumed/composed the one which is ending, or perhaps this will lead to there being no current performable (if the ending performable was at the root of the performance).
RecordResultForCurrentPerformable(object)
Enriches the current performable with information about its result.
public void RecordResultForCurrentPerformable(object result)
Parameters
result
objectThe result of the performable
Remarks
This method is only applicable to performables which may return a result.
SpotlightTurnedOff()
Adds a report to the current performance indicating that the spotlight has been turned off.
public void SpotlightTurnedOff()
Remarks
For more information, see the spotlight glossary item.