Release v16.7.0
Summary
ReactorScenario<T> now resolves reactor handler-method dependencies the way the production reactor pipeline does, and the in-process scenario helpers gain matching ergonomics — register dependencies through a Services collection, seed read models directly, and assert the side effects a reactor returns — so testing reactors and read models no longer requires hand-building a service provider or mocking the event store.
Added
ReactorScenario<T>.Servicescollection (with logging registered by default) and anAction<IServiceCollection>constructor for registering a reactor's dependencies.Given.ForEventSourceId(id).ReadModel(...)to seed read-model handler-method parameters in a reactor scenario.ReactorScenario<T>.ShouldHaveProduced<T>()/ShouldNotHaveProduced<T>()and aProducedlist to assert the events and commands a reactor returns as side effects, with no mocked event store.ReadModelScenario<T>.Servicescollection for registering reducer and projection dependencies without supplying a fullIServiceProvider.CannotActivateReactorForScenario, thrown with the name of the dependency that could not be resolved when a reactor cannot be constructed.
Changed
- A
ReactorScenario<T>created without an explicitIServiceProvidernow builds one fromServices(standard dependency injection with logging registered) instead of usingDefaultServiceProvider. A reactor that relied onDefaultServiceProviderconstructing an unregistered concrete dependency must now register it.
Fixed
ReactorScenario<T>now resolves reactor handler-method parameters — injected services and materialized read models — instead of failing to resolve them.