What problem does it solve?
This skill provides patterns and best practices to reliably test event-sourced aggregates in .NET projects, reducing brittle tests and manual setup when events have private constructors or complex nested data.
Core Features & Use Cases
- Constructor bypassing: Use a CustomConstructorFaker pattern to instantiate event and data types without invoking primary constructors.
- Deterministic fakers: Create event and event-data fakers that populate metadata and nested properties for repeatable test scenarios.
- Assertion extensions and integration helpers: Field-by-field assertions between protobuf requests and persisted events, plus DbContextHelper and GrpcClientHelper to validate database persistence and outbox messaging in integration tests.
- Use Case: Add comprehensive tests for create and update commands that verify event sequences, outbox messages, and correct exception handling for duplicates or invalid operations.
Quick Start
Create an integration test that uses a CustomConstructorFaker to generate an OrderCreated event, sends the corresponding gRPC command via GrpcClientHelper, and asserts persisted events and outbox messages with the provided assertion extensions.