public void GetReservationsByDateIVCommandTest()
        {
            GetReservationsByDateIVCommand command = CommandFactory.CreateGetReservationsByDateIVCommand(1, 2, "2019-01-01", "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, string arrivaldate, int numpas)
        {
            try
            {
                GetReservationsByDateIVCommand command =
                    CommandFactory.CreateGetReservationsByDateIVCommand(departure, arrival, departuredate, arrivaldate, numpas);
                command.Execute();
                List <Entity> listFlight = command.GetResult();

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