Module 11 · Lesson 115 min
The test stack and its idioms
Four libraries, and you'll recognise the shape from Jest even though the names differ. xUnit is the runner: [Fact] marks a test method (like it(...)). Shouldly is the assertion library: result.IsSuccess.ShouldBeTrue(), value.ShouldBe(60), Should.Throw<T>(...), readable and specific. NSubstitute is the mock library: Substitute.For<IRepo>() fakes an interface. AutoFixture builds test data so you don't hand-construct objects whose exact values don't matter.
Try it yourself
Do
Test the VO you built
Write the test the way the team writes it, boundaries included.
Tick every step to confirm you did it.
Quiz
How to fake a repository
Your use-case test needs a fake IFlightDisruptionAggregateRepository. What do you write?