Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            //new up manager and invoke the run method
            StarShipManager star = new StarShipManager();

            star.Run();
        }
Ejemplo n.º 2
0
 public void ParseConsoleInputTest()
 {
     try
     {
         var starShipManager = new StarShipManager();
         var totalJourney    = "1000000";
         var state           = starShipManager.ParseUserInput(totalJourney);
         Assert.IsTrue(state.ToString().Length > 0);
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Error in ParseConsoleInputTest {ex.Message}");
     }
 }
Ejemplo n.º 3
0
        static async System.Threading.Tasks.Task Main(string[] args)
        {
            Console.WriteLine("Please input the distance: ");
            string distanceInput = Console.ReadLine();

            int distance;

            if (!int.TryParse(distanceInput, out distance))
            {
                Console.WriteLine("Wrong format. Please input a number next time. Press ENTER to exit.");
                Console.ReadLine();
                return;
            }

            IStarShipManager starShipManager = new StarShipManager();
            await starShipManager.PrintStopsQuantityForEachStarShip(distance);

            Console.WriteLine("\r\n\r\nPress ENTER to exit.");
            Console.ReadLine();
        }