public async Task WhenDroveCustomerToTrainStation_ShouldUpdateReadModel() { // Arrange var payload = _fixture.Create <DroveCustomerToTrainStation>(); var expected = _fixture.Create <CabRide>(); _cabRideMapper .Map(Arg.Any <DroveCustomerToTrainStation>()) .Returns(expected); // Act await _sut.Handle(payload); // Assert await _cabRideRepository .Received(1) .Save(Arg.Is(expected)); }
private async Task UpdateReadModel(DroveCustomerToTrainStation message) { var cabRide = _cabRideMapper.Map(message); await _cabRideRepository.Save(cabRide); }