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

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

            Assert.AreNotEqual(null, listFlight);
        }
Esempio n. 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));
            }
        }
        //Obtener reservas de ida y vuelta con acientos inválidos
        public void GetReservationsByDateIVCommandPassengersLocExTest()
        {
            GetReservationsByDateICommand command = CommandFactory.CreateGetReservationsByDateICommand(1, 2, "2019-01-01", -1);

            Assert.Throws <ValidationErrorException>(delegate { command.Execute(); });
        }