public void CreateFlight(string airlineName, string originAirportName, string destinationAirportName, string year, string month, string day, string flightId) { try { flightService.CreateFlight(airlineName, originAirportName, destinationAirportName, year, month, day, flightId); Console.WriteLine("Flight successfully created"); } catch (Exception e) { Console.WriteLine(e.Message); } }
public void FlightCreate() { FlightService flightService = new FlightService(unitOfWork); FlightDTO flightDTO = new FlightDTO() { DeperturePlace = "testing", ArrivalPlace = "test", DepartureTime = new DateTime(1, 4, 3), ArrivalTime = new DateTime(1, 3, 4) }; flightService.CreateFlight(flightDTO); Flight flight = fakeFlightRepository.Get(1); Assert.AreEqual(flight.DeperturePlace, flightDTO.DeperturePlace); Assert.AreEqual(flight.ArrivalPlace, flightDTO.ArrivalPlace); Assert.AreEqual(flight.DepartureTime, flightDTO.DepartureTime); Assert.AreEqual(flight.ArrivalTime, flightDTO.ArrivalTime); }