/// <summary> /// Create test runways /// </summary> /// <param name="_tower"></param> private static void CreateRunways(ITower _tower) { int numberOfRunways = 0; bool repeat = true; while (repeat) { Console.WriteLine(); Console.WriteLine("Enter the number of Runways at this airport. Maximum 5"); string numberOfRunwaysAsString = Console.ReadLine(); repeat = !int.TryParse(numberOfRunwaysAsString, out numberOfRunways); if (numberOfRunways > 5 || numberOfRunways < 1) { repeat = true; } } Random _randon = new Random(); while (numberOfRunways > 0) { IRunway _runway = ServiceLocator.Resolve<IRunway>(); _runway.RunwayDesignation = (RunwayDesignation)numberOfRunways; _runway.IsRunwayAvailable = true; Console.WriteLine("***"); Console.WriteLine(); Console.WriteLine("Runway " + _runway.RunwayDesignation + " is currently free for use"); Console.WriteLine(); _tower.AddRunways(_runway); numberOfRunways--; } }