Repository navigation
Release v24.6.0
Availability is now declared with C# types that map one to one onto Screenplay, and the Screenplay generator reads the rules back instead of reporting that they were left in code.
Added
- Audiences are types:
public class Plus : Audience;, found withITypes, so a typo is a compile error. - Availability blocks are types that define their lines with
For<T>(),With<T>(),Not<T>()andWhen, combined with&,|and parentheses.Notis three-valued, so an unknown audience keeps the gate closed. - Attributes refer to the types:
[AvailableFor<Plus>](up to three audiences, any of which opens the gate),[Available<DataQuality>]and[AvailableWhen<HasPaidInvoice>]. - Conditions come in two forms: a restricted comparison such as
When.On<Vessel>(_ => _.CommercialPackage).IsNot(Package.Basic)that compiles to a Screenplaywhen, and an injectableIAvailabilityConditionclass that is emitted as an opaque condition. [ProvideContext<Vessel>(...)]provides a read model as a typed context value, keyed from the arguments of the command or query.- A type that derives from
AvailabilityScopegates the module, feature or slice of its namespace. - The Screenplay generator emits
audience,availabilityblocks withfor,when,withandnot, module, feature and slice gates, andprovidelines from these declarations (#3980).
Changed
- The Screenplay package is raised to 6.43.0.
- A line that mixes forms with
&is written as a line for each form; mixing forms beneath|ornotis reported, not guessed.
Deprecated
[AvailableFor("name")],[AvailableWith("name")], theAvailabilityExpressionfactories andGateNamespaceare obsolete, with a migration table in the availability documentation.