Skip to content

Release v22.67.0

Choose a tag to compare

@github-actions github-actions released this 11 Oct 03:34
1a44b02

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, and PinGeneratedValue<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() inside Handle and from the removed IIdentitySource and CommandScenario.Generate(...) to [GeneratedValue] and PinGeneratedValue. (part of #3128)