Table of Contents

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 IGetsValueFormatter

A value formatter factory

formatter IFormatsReportFragment

A 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 Actor

The 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

actor Actor

The actor

ability object

The ability which was granted

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 Actor

The 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 object

The performable obeject which has begun

actor Actor

The actor executing the performable

performancePhase string

The 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 object

The performable which is ending

actor Actor

The 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 string

The file path to the asset

assetSummary string

The 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 Exception

The 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 object

The 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.