public void GetReservationFlightByUserCommandTest() { GetReservationFlightByUserCommand command = CommandFactory.CreateGetReservationFlightByUserCommand(1); command.Execute(); List <Entity> listFlight = command.GetResult(); Assert.AreNotEqual(null, listFlight); }
public ActionResult <IEnumerable <Entity> > Get(int id_user) { try{ //Instancia del comando GetReservationFlightByUserCommand command = CommandFactory.CreateGetReservationFlightByUserCommand(id_user); //Ejecuta y obtiene el resultado del comando command.Execute(); List <Entity> listFlight = command.GetResult(); return(listFlight); }catch (ValidationErrorException ex) { return(BadRequest(ex.Message)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }