Rendering should include rendering Given/When/Then into Cratis Specifications, leveraging the constructs we have. Nothing is rendered today — there are no references to specifications anywhere in the renderer's production code.
Targets available
The in-process scenario family: CommandScenario<TCommand>, EventScenario, ReadModelScenario<TReadModel>, ReactorScenario<TReactor>.
Mapping, and the gaps
| Screenplay |
Target |
Notes |
when <command> + then <events> |
CommandScenario<T> → Execute() + ShouldHaveAppendedEvent<,> |
clean fit |
then error |
ShouldNotBeSuccessful() + ShouldHaveValidationErrors() |
clean fit; a bare then error maps naturally, since the conventions forbid asserting on message strings |
given <events> on a State View |
ReadModelScenario<T> → Given.ForEventSource(id).Events(…) |
clean fit |
given readmodel / then readmodel |
ReadModelScenario, or bridged into CommandScenario via Services |
also dropped on ingest — Source/Contracts/Screenplay/SpecificationConverter.cs reads only given events, when, then events and then errors, while SpecificationSyntax exposes GivenReadModels and ThenReadModels |
given <events> on a State Change slice |
— |
structural gap: CommandScenario has no Given/Events; prior state has to be seeded through Services |
So there are two separate pieces of work: the renderer emits no specs, and the ingest converter drops read-model given/then before the renderer could ever see them.
Emitted specs need to carry the repo conventions — the for_ / when_ / and_ folder hierarchy, #if DEBUG wrapping, and the paired ShouldNotBeSuccessful() + ShouldHaveValidationErrors() on every unhappy path.
Rendering should include rendering Given/When/Then into Cratis Specifications, leveraging the constructs we have. Nothing is rendered today — there are no references to specifications anywhere in the renderer's production code.
Targets available
The in-process scenario family:
CommandScenario<TCommand>,EventScenario,ReadModelScenario<TReadModel>,ReactorScenario<TReactor>.Mapping, and the gaps
when <command>+then <events>CommandScenario<T>→Execute()+ShouldHaveAppendedEvent<,>then errorShouldNotBeSuccessful()+ShouldHaveValidationErrors()then errormaps naturally, since the conventions forbid asserting on message stringsgiven <events>on a State ViewReadModelScenario<T>→Given.ForEventSource(id).Events(…)given readmodel/then readmodelReadModelScenario, or bridged intoCommandScenarioviaServicesSource/Contracts/Screenplay/SpecificationConverter.csreads only given events, when, then events and then errors, whileSpecificationSyntaxexposesGivenReadModelsandThenReadModelsgiven <events>on a State Change sliceCommandScenariohas noGiven/Events; prior state has to be seeded throughServicesSo there are two separate pieces of work: the renderer emits no specs, and the ingest converter drops read-model given/then before the renderer could ever see them.
Emitted specs need to carry the repo conventions — the
for_/when_/and_folder hierarchy,#if DEBUGwrapping, and the pairedShouldNotBeSuccessful()+ShouldHaveValidationErrors()on every unhappy path.