public void Adds_a_new_statistics_record_if_none_exists() { // Arrange var statsStub = new FakeDbSet <Stats>(); var readModelMock = new Mock <IFishLogReadModel>(); readModelMock.Setup(m => m.Statistics).Returns(statsStub); var denormalizer = new StatisticsDenormalizer(readModelMock.Object); // Act denormalizer.Handle(new CatchLoggedEvent()); // Assert Assert.That(statsStub.Any()); Assert.That(statsStub.First().TotalCatches, Is.EqualTo(1)); readModelMock.Verify(m => m.SaveChanges(), "No changes were saved."); }