Skip to content

Make command scenarios discover validators#2289

Merged
woksin merged 1 commit into
mainfrom
command-scenario
Jun 12, 2026
Merged

Make command scenarios discover validators#2289
woksin merged 1 commit into
mainfrom
command-scenario

Conversation

@woksin

@woksin woksin commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Command scenarios now exercise command validators discovered by Arc, including validators with scenario-provided dependencies and manual overrides.

Added

  • Specs covering automatic dependency-backed command validator execution in CommandScenario<TCommand>.
  • Specs covering missing validator dependencies and manual concrete validator overrides.
  • A spec proving validators can receive interface-backed scoped dependencies from scenario.Services without manually registering the validator.
  • JavaScript command result specs covering primitive command responses.

Changed

  • CommandScenario<TCommand> registers discovered validators in its isolated service provider so scenario validation matches runtime command execution without leaking validators or dependencies across scenarios.
  • Existing concrete validator registrations are preserved; scenarios only add missing validator registrations, so custom factories/lifetimes and manual overrides still win.
  • JavaScript CommandResult now preserves primitive command responses directly instead of passing strings, numbers, and booleans through object deserialization.
  • Added a narrow CA2000 ownership suppression for the query-health observable wrapper so Release builds recognize the existing disposal ownership pattern.

@woksin woksin force-pushed the command-scenario branch from 5e1ae84 to 8d84d7e Compare June 11, 2026 09:30
Comment thread Source/DotNET/Testing/Commands/CommandScenario.cs Fixed
@github-actions

Copy link
Copy Markdown

NuGet packages for this PR, e.g. Cratis.Arc:
https://github.com/cratis/arc/packages/1655206?version=20.40.3

@woksin woksin force-pushed the command-scenario branch 3 times, most recently from 0979bb8 to f03126c Compare June 11, 2026 10:08
@woksin woksin force-pushed the command-scenario branch from f03126c to a52f6a3 Compare June 11, 2026 10:35
@woksin woksin added the patch label Jun 12, 2026
@woksin woksin merged commit 355e6ce into main Jun 12, 2026
54 checks passed
@woksin woksin deleted the command-scenario branch June 12, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant