public void ShowReservationsByUserTest() { int userId = 1; mockRepository.Setup(x => x.ShowReservationsByUser(userId)) .Returns(listaReservationsDTO.Where(y => y.UsuarioId == userId)); var handler = new ShowReservationsByUserHandler(mockRepository.Object); ShowReservationsByUser re = new ShowReservationsByUser(userId); var res = handler.Handle(re, ct); Assert.IsNotNull(res.Result); }
public Task <IEnumerable <ReservationDTO> > Handle(ShowReservationsByUser request, CancellationToken cancellationToken) { return(Task.Run(() => { return reservationRepository.ShowReservationsByUser(request.Id); })); }