private static void FindBestRoute(string[] args, string[] splittedRoute) { var routeService = new RouteService(); var filePath = args[0]; var bestRoute = routeService.GetBestRoute($"{splittedRoute[0]}", $"{splittedRoute[1]}", filePath); Console.Clear(); if (!bestRoute.Contains("No route found")) { SetConsoleColors(false); } else { SetConsoleColors(false); } Console.WriteLine($"\n{bestRoute}\n"); Console.ResetColor(); }
public String GetBestRoute(String from, String to, String filePath = DEFAULT_FILE_PATH) { return(_routeService.GetBestRoute(from.ToUpper(), to.ToUpper(), filePath)); }
public void GetBestRouteWithValidFileAndRoutesShouldReturnWithSuccess(string from, string to, string expected) { var bestRoute = _routeService.GetBestRoute(from, to, FILE_PATH); Assert.Equal(expected, bestRoute); }