Class PerformableReport
- Namespace
- CSF.Screenplay.ReportModel
- Assembly
- CSF.Screenplay.dll
An implementation of ReportableModelBase which represents the execution of a performable item.
public class PerformableReport : ReportableModelBase
- Inheritance
-
PerformableReport
- Inherited Members
Remarks
Reports about performables may themselves contain further reportables. This may create a hierarchical structure of reports which contain further reports, and so on. This represents the use of high-level performables which consume/compose lower-level performables.
Properties
Assets
Gets or sets a collection of the assets which were recorded by the current performable.
[JsonIgnore]
public List<PerformableAsset> Assets { get; set; }
Property Value
Ended
Gets or sets the relative time at which this performable ended/finished.
public TimeSpan Ended { get; set; }
Property Value
Remarks
This property is expressed as an amount of time since the Screenplay began. The beginning of the Screenplay is recorded in the report metadata, at Timestamp.
Recall that it is quite normal for performances and thus reportable actions to occur in parallel. Do not be alarmed if it appears that unrelated performances are interleaved with regard to their timings.
- See Also
Exception
Gets or sets a value which is the string representation of any Exception which occurred, causing the performable to fail.
public string Exception { get; set; }
Property Value
Remarks
If this property is non-null then the performable has failed with an exception, and this property will contain the result of ToString() for that error.
If this property is null then the performable did not raise an exception and completed successfully.
ExceptionIsBubbling
Gets a value which indicates whether or not the Exception is one which was originally thrown from a consumed performable, 'bubbling' up the call stack.
public bool ExceptionIsBubbling { get; set; }
Property Value
Remarks
If Exception is null then the value of this property is meaningless and undefined. If the exception is not null then - if this property is set to true then it means that exception which is recorded for this performable was originally thrown from a performable which was consumed by the current one.
When this is true, it means that the error did not originate within the current performable. The current performable
has failed only because a consumed/child performable encountered an error, and that error is 'bubbling' up the call stack, failing each consuming
performable, until it reaches a catch block or the performance ends.
If, on the other hand, Exception is not null and this property value is false then it indicates that the current performable is the original source of the error.
HasResult
Gets or sets a value that indicates whether or not the performable (which generated this report) emitted a result.
public bool HasResult { get; set; }
Property Value
Remarks
This property will be true if the original performable which lead to this report derived from either IPerformableWithResult or IPerformableWithResult<TResult> (and did not fail). For performables which do not emit a result, this value will always be false.
- See Also
Phase
Corresponds to the PerformancePhase to which the current reportable is part.
public string Phase { get; set; }
Property Value
Remarks
This property contains the string representation of that performance phase. This property should always have a non-null value at the top-level of a performance. At deeper levels, it is acceptable for this property to be null, since all consumed performables are presumed to inherit the performance phase of their consumer.
This property normalises null, empty or whitespace-only values to null, so that this property may be skipped when it is empty.
Reportables
Gets or sets a collection of the reportable items which have been composed by the current performable.
[JsonIgnore]
public List<ReportableModelBase> Reportables { get; set; }
Property Value
Remarks
This collection is commonly populated for task performables, because the nature of tasks is to consume and compose other performables. This collection can create a hierarchical structure of performables composing other performables. That structure could be deeply nested.
Result
Gets or sets a string representation of the result which was emitted by the corresponding performable.
public string Result { get; set; }
Property Value
Remarks
This property is only relevant if the original performable which lead to this report derived from either IPerformableWithResult or IPerformableWithResult<TResult>. For performables which do not emit a result, this value will always be null.
- See Also
SerializableAssets
Gets or sets a representation of Assets which is designed for JSON serialization.
[JsonPropertyName("Assets")]
public List<PerformableAsset> SerializableAssets { get; set; }
Property Value
Remarks
Notably, this property getter will return null if Assets is empty. This is desirable for serialization, because it allows us to ignore/skip this property when it's empty. For general use as a developer, use Assets instead.
SerializableReportables
Gets or sets a representation of Reportables which is designed for JSON serialization.
[JsonPropertyName("Reportables")]
public List<ReportableModelBase> SerializableReportables { get; set; }
Property Value
Remarks
Notably, this property getter will return null if Reportables is empty. This is desirable for serialization, because it allows us to ignore/skip this property when it's empty. For general use as a developer, use Reportables instead.
Type
Gets or sets type information for the performable item to which this report model relates.
public string Type { get; set; }
Property Value
Remarks
In many cases this is equal to the FullName of the performable class. However, it does not have to be. This is a human-readable value which is intended to convey useful information to a reader (who understands what a .NET type is) about the performable type.
Consider a performable type which is an adapter class, that wraps a more specific performable. The full name of the performable type itself might not be very useful, as it would only indicate a general-use adapter type. This becomes even less useful when the adapter type is generic. Performable types which are general-use adapters, which would 'hide' a more specific (and useful) performable type may implement IHasCustomTypeName. Performable types which derive from the custom type name interface populate this value with the value retrieved from GetHumanReadableTypeName() instead of their type's full name..