Skip to content

Release v24.6.0

Choose a tag to compare

@github-actions github-actions released this 24 Nov 21:19
b382d7e

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 with ITypes, so a typo is a compile error.
  • Availability blocks are types that define their lines with For<T>(), With<T>(), Not<T>() and When, combined with &, | and parentheses. Not is 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 Screenplay when, and an injectable IAvailabilityCondition class 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 AvailabilityScope gates the module, feature or slice of its namespace.
  • The Screenplay generator emits audience, availability blocks with for, when, with and not, module, feature and slice gates, and provide lines 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 | or not is reported, not guessed.

Deprecated

  • [AvailableFor("name")], [AvailableWith("name")], the AvailabilityExpression factories and GateNamespace are obsolete, with a migration table in the availability documentation.