Example #1
0
 public IHttpActionResult GetShortestRoute(string origin, string destination)
 {
     try
     {
         AirNetwork airNetwork = new AirNetwork(airlineRepo.GetAllAirlines(), airportRepo.GetAllAirports(), flightRepo.GetAllFlights());
         return(Ok(airNetwork.GetShortestRoute(origin, destination)));
     }
     catch (CustomException ce)
     {
         return(Content(HttpStatusCode.NotFound, ce.Message));
     }
     catch (Exception e)
     {
         return(InternalServerError(e));
     }
 }
Example #2
0
 public void GetShortestRoute_OriginNotFound_KnownDestination()
 {
     airNetwork.GetShortestRoute("NotFound", "A1");
 }