Testowanie
Często słychać, że Event Sourcing trudno testować. Tymczasem jego logika biznesowa dobrze się do tego nadaje: mając wcześniejsze zdarzenia, uruchamiasz komendę i oczekujesz nowych zdarzeń albo błędu. Ten sam schemat Given/When/Then sprawdza się przy projekcjach, tylko wynikiem jest read model.
Pierwszy artykuł pokazuje takie testy w C# dla deciderów i agregatów, ale wzorzec przeniesiesz do każdego języka. Dalej są testy integracyjne projekcji w MongoDB w TypeScripcie i krótki tekst o tym, jak w .NET poczekać na asynchroniczne handlery bez pollingu. Artykuł o testach z Emmettem pokazuje w Node.js testy od jednostkowych po end-to-end, a kolejny wyjaśnia, jak skonfigurować własny kontener Testcontainers dla EventStoreDB.
Ostatni tłumaczy, dlaczego Behaviour-Driven Design to skupienie na zachowaniu systemu na każdym etapie pracy, a nie tylko testy.

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…