Repository navigation
Release v22.67.0
Summary
Specs can now pin the values a command generates through [GeneratedValue] Handle parameters, so assertions use known ids instead of reaching into events for random ones.
Added
CommandScenario<TCommand>.PinGeneratedValue(name, value)pins a generated value by its parameter name, andPinGeneratedValue<TCommand, TOtherCommand>(name, value)pins one for a command that runs inside the scenario's command. Pins are fixed once the first command starts executing. (part of #3128)- Generated values are strict by default in a scenario: a command whose generated value is not pinned fails with a message that names the command, the parameter and how to fix it.
AllowGeneration()lets the scenario generate real values instead. (part of #3128) CommandScenario<TCommand>.GeneratedValues.Last<T>(name)and.All<T>(name)return the values a scenario generated or pinned. (part of #3128)- Documentation on testing generated values, and an upgrade guide for moving from
New()insideHandleand from the removedIIdentitySourceandCommandScenario.Generate(...)to[GeneratedValue]andPinGeneratedValue. (part of #3128)