예제 #1
0
        public async Task Deveria_recuperar_reserva_de_carro_com_sucesso()
        {
            int expected = 1;
            List <CarReservation> reservations = new List <CarReservation>()
            {
                CarReservationBuilder.Start().Build(),
                                  CarReservationBuilder.Start().Build()
            };

            _fakeRepository.Setup(x => x.GetAll()).ReturnsAsync(reservations);

            var cmd = new CarReservationLoadAllQuery();

            var result = await _handler.Handle(cmd, It.IsAny <CancellationToken>());

            result.Should().BeOfType <List <CarReservation> >();
            result.Should().HaveCount(2);
            _fakeRepository.Verify(x => x.GetAll(), Times.Once);

            //TODO: Verificar registro atualizado.
        }
예제 #2
0
 public Task <List <CarReservation> > Handle(CarReservationLoadAllQuery request, CancellationToken cancellationToken)
 {
     return(_repository.GetAll());
 }