Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 private async Task UpdateReadModel(DroveCustomerToTrainStation message)
 {
     var cabRide = _cabRideMapper.Map(message);
     await _cabRideRepository.Save(cabRide);
 }