Part of #5118 (compliance wave growth), epic #5110.
FetchLatest<T> and ProjectLatest<T> are declared on the shared JasperFx.Events.IEventStoreOperations (FetchLatest<T>(Guid|string), FetchLatest<T, TId>(TId), ProjectLatest<T>(Guid|string)), so this suite is portable with no seam addition.
The behavior is subtle enough to be worth pinning cross-store: FetchLatest has to give the same answer regardless of whether the aggregate is Live, Inline or Async, which means folding unsaved-but-appended events on top of a persisted snapshot, and reading through the identity map when one is in play.
What each store tests today
| Marten |
Polecat |
EventSourcingTests/Projections/project_latest_tests.cs |
Events/fetch_latest_tests.cs |
Aggregation/when_finding_the_last_good_aggregation.cs |
Events/project_latest_tests.cs |
EventSourcingTests/FetchForWriting/* (FetchLatest cases) |
Events/use_identity_map_for_aggregates.cs |
Scope
New FetchLatestCompliance suite:
FetchLatest against Live, Inline and Async registration of the same aggregate returns identical state
FetchLatest after appending in the same uncommitted session sees the pending events
FetchLatest returns null for an unknown stream, and for a stream whose aggregate folds to null
ProjectLatest vs FetchLatest divergence (projection-vs-storage read) is asserted explicitly rather than assumed
- Repeated
FetchLatest in one session returns the same instance where an identity map is in play, and a fresh instance where it is not
- Guid and string stream identity
Acceptance
- Suite enrolled in both stores, zero capability gates
- Originals retired in both repos
Part of #5118 (compliance wave growth), epic #5110.
FetchLatest<T>andProjectLatest<T>are declared on the sharedJasperFx.Events.IEventStoreOperations(FetchLatest<T>(Guid|string),FetchLatest<T, TId>(TId),ProjectLatest<T>(Guid|string)), so this suite is portable with no seam addition.The behavior is subtle enough to be worth pinning cross-store:
FetchLatesthas to give the same answer regardless of whether the aggregate is Live, Inline or Async, which means folding unsaved-but-appended events on top of a persisted snapshot, and reading through the identity map when one is in play.What each store tests today
EventSourcingTests/Projections/project_latest_tests.csEvents/fetch_latest_tests.csAggregation/when_finding_the_last_good_aggregation.csEvents/project_latest_tests.csEventSourcingTests/FetchForWriting/*(FetchLatest cases)Events/use_identity_map_for_aggregates.csScope
New
FetchLatestCompliancesuite:FetchLatestagainst Live, Inline and Async registration of the same aggregate returns identical stateFetchLatestafter appending in the same uncommitted session sees the pending eventsFetchLatestreturns null for an unknown stream, and for a stream whose aggregate folds to nullProjectLatestvsFetchLatestdivergence (projection-vs-storage read) is asserted explicitly rather than assumedFetchLatestin one session returns the same instance where an identity map is in play, and a fresh instance where it is notAcceptance