Beispiel #1
0
 private static void ParkingVerification()
 {
     if (ParkingLotChecks.CheckForFreeParkingSpaces(StarshipFetcher.GetListOfStarships(), registration.ShipName))
     {
         Console.WriteLine("There is a parking space available for your ship.");
         registration.ParkingSpace = new Random().Next(0, 126);  // Placeholder istället för att faktiskt välja en korrekt parkeringsplats
     }
     else
     {
         Console.WriteLine("No parking space available at the moment.");
     }
 }
Beispiel #2
0
        private static void ShipVerification()
        {
            Console.WriteLine("Enter the name of the ship:");
            registration.ShipName = Console.ReadLine();

            if (ShipChecker.TestIfShipIsInStarWars(StarshipFetcher.GetListOfStarships(), registration.ShipName
                                                   ))
            {
                Console.WriteLine("This ship is approved");
            }
            else
            {
                Console.WriteLine("Wrong ship. Try again");
                ShipVerification();
            }
        }
Beispiel #3
0
 public void StarshipChecker_Returns_False_If_Invalid_Name_Is_Entered()
 {
     Assert.False(ShipChecker.TestIfShipIsInStarWars(StarshipFetcher.GetListOfStarships(), "Centennial Screechbird"));
 }
Beispiel #4
0
 public void StarshipChecker_Returns_True_If_Valid_Name_Is_Entered()
 {
     Assert.True(ShipChecker.TestIfShipIsInStarWars(StarshipFetcher.GetListOfStarships(), "Millennium Falcon"));
 }