Testing utilities for EventCore backends and commands.
This crate provides helpers for verifying that EventStore implementations
satisfy their behavioral contracts, injecting failures for chaos and retry
testing, and writing readable Given-When-Then command tests.
Modules
-
[
contract] — Behavioral contract tests via thebackend_contract_tests!macro. Run these against anyEventStoreimplementation to verify it upholds all required guarantees (optimistic concurrency, atomicity, ordering, etc.). -
[
chaos] — [ChaosEventStore]: wraps anEventStoreand injects probabilistic failures. Use for chaos testing to verify that command retry logic handles transient errors correctly. -
[
deterministic] — [DeterministicConflictStore]: injects predictable stream-version conflicts on the first write attempt, then succeeds on retry. Use for deterministic testing of the automatic retry path ineventcore::execute(). -
[
event_collector] — [EventCollector]: aProjectorimplementation that accumulates every event it sees into aVec. Use in assertions to confirm which events were written to the store. -
[
scenario] — [TestScenario]: a Given-When-Then builder for command tests. Seed the store with prior events (Given), execute a command (When), and assert on the resulting events or error (Then).