public void Given_i_have_a_list_of_flight_i_should_output_list_of_flights() { //Arrange IFlightReservationService facade = new FlightReservationService(_airportRepository, _flightRepository, _airportFlightRepository); //Act var result = facade.GetFlightDetail(); //Assert Assert.AreEqual(4, result.Count()); }
public void Given_a_flight_is_Cancel_i_should_see_the_cancelled_flight() { //Arrange IFlightReservationService facade = new FlightReservationService(_airportRepository, _flightRepository, _airportFlightRepository); //Act facade.CancelFlight(1); var result = facade.GetDepartureFlight("LTN");//.Where(x => x.FlightStatus == "Cancelled"); //Assert Assert.AreEqual("Cancelled", result[0].FlightStatus); }
public void Given_i_have_list_of_flights_it_should_orderby_departuredate() { //Arrange IFlightReservationService facade = new FlightReservationService(_airportRepository, _flightRepository, _airportFlightRepository); //Act var result = facade.GetFlightDetail("DepartureTime"); //Assert Assert.AreEqual(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 12, 0, 0), result[0].DepartureTime); Assert.AreEqual(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 13, 0, 0), result[1].DepartureTime); Assert.AreEqual(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 14, 0, 0), result[2].DepartureTime); }
public void Given_i_have_added_a_new_flight_i_should_see_the_new_flight_in_list_of_flights() { //Arrange FlightDetail flightDetail = new FlightDetail() { ArrivalAirport = "Gatwick", DepartureAirport = "Luton", ArrivalTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 14, 0, 0), DepartureTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 0, 0) }; IFlightReservationService facade = new FlightReservationService(_airportRepository, _flightRepository, _airportFlightRepository); //Act facade.AddFlight(flightDetail); var result = facade.GetFlightDetail(); //Assert Assert.AreEqual(5, result.Count()); }
public void Given_i_want_to_search_flights_by_arrival_airport_i_should_get_filter_arrival_airport_flights() { //Arrange IFlightReservationService facade = new FlightReservationService(_airportRepository, _flightRepository, _airportFlightRepository); //Act var result = facade.GetArrivalFlight("LGW"); //Assert Assert.AreEqual(2, result.Count()); }