Testing
You may have heard that Event Sourcing is hard to test. Its business logic is actually a good fit for tests: given past events, when you run a command, then you expect new events or an error. The same Given/When/Then shape works for projections, only the result is a read model.
The first article builds such tests in C# for deciders and aggregates; the pattern works in any language. Next come integration tests for MongoDB projections in TypeScript, and a short .NET piece on waiting for asynchronous handlers without polling. The Emmett article covers Node.js from unit to end-to-end tests, and the next one sets up a custom Testcontainers container for EventStoreDB.
The last article explains why Behaviour-Driven Design means keeping the system’s behaviour in focus everywhere, not only in tests.

Testing business logic in Event Sourcing, and beyond!
2022-10-07I’ve heard a few times that Event Sourcing is hard to test. I’m not sure where this myth comes from; maybe from mixing it with event streaming. Event Sourcing logic is…
How to test event-driven projections
2023-04-29Projections in an event-driven world are a way to interpret registered events. We can take a sequence of events and build from them read models in a predictable way. They…
Testing asynchronous processes with a little help from .NET Channels
2022-12-04Let’s say that you have an event-driven application. It has an event bus that listens for events from asynchronous processes (e.g. Kafka consumer or outbox pattern). Once…
Testing Event Sourcing, Emmett edition
2024-03-23I’ve been going pretty down the rabbit hole in the last few years. What am I searching for? A way to deliver better software. And that’s, of course, a “thank you for…
How to configure a custom Test Container on the EventStoreDB example
2024-04-28Testcontainers became a popular way of setting up dependencies for integration testing. They’re not ideal, as configuring them to run your tests efficiently is not as…
Behaviour-Driven Design is more than tests
2023-08-17Why did I name the testing library Ogooreck? Between my friends, I’m well known for my lame jokes. Ogooreck is one of them. Ogooreck is a phonetical written Ogórek…