public void GetReservationsByDateICommandTest()
        {
            GetReservationsByDateICommand command = CommandFactory.CreateGetReservationsByDateICommand(1, 2, "2019-01-01", 1);

            command.Execute();
            List <Entity> listFlight = command.GetResult();

            Assert.AreNotEqual(null, listFlight);
        }
Пример #2
0
        public ActionResult <IEnumerable <Entity> > Get(int departure, int arrival, string departuredate, int numpas)
        {
            try
            {
                GetReservationsByDateICommand command =
                    CommandFactory.CreateGetReservationsByDateICommand(departure, arrival, departuredate, numpas);
                command.Execute();
                List <Entity> listFlight = command.GetResult();

                return(listFlight);
            }catch (ValidationErrorException ex)
            {
                return(BadRequest(ex.Message));
            }catch (Exception ex) {
                return(BadRequest(ex.Message));
            }
        }