Repository navigation
Release v22.69.0
Summary
QueryScenario can now exercise observable queries, so a specification can assert both the first result of a query that returns ISubject<T> and the updates it pushes afterwards.
Added
QueryScenario.Observe(...)subscribes to an observable orIAsyncEnumerable<T>query and returns aQueryObservation.Initialis the first result, andNext(timeout)waits for the next one. Results are buffered from the moment of subscription, so a specification never has to sleep, and each result goes through read-model interceptors and emission guards the same way it does over SSE and WebSocket. (#3153)- Documentation for observable queries in
QueryScenario, including the limits: a result fromNextis the next emission, not the next distinct value, and MongoDB.Observe()queries need a real database. (#3153)
Changed
QueryScenario.Performreturns the first result of a query that returnsISubject<T>orISubject<IEnumerable<T>>, the same result a plain HTTP request gets, instead of throwingStreamingQueryNotSupported. (#3153)- Disposing a
QueryScenarioalso ends its observations, after any startup and in-flight processing have settled.QueryObservation.Dispose()starts disposal without waiting; useDisposeAsync()or dispose the scenario to wait for cleanup. (#3153)