eventcore-testing 1.0.1

Testing utilities and shared test suite for EventCore event stores
Documentation

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 the backend_contract_tests! macro. Run these against any EventStore implementation to verify it upholds all required guarantees (optimistic concurrency, atomicity, ordering, etc.).

  • [chaos] — [ChaosEventStore]: wraps an EventStore and 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 in eventcore::execute().

  • [event_collector] — [EventCollector]: a Projector implementation that accumulates every event it sees into a Vec. 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).