Skip to content

Render Given/When/Then into Cratis Specifications #14

Description

@woksin

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 ingestSource/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions