예제 #1
0
 void Start()
 {
     if (instance)
     {
         Debug.LogWarning("More than one instance of Ship Checker");
         return;
     }
     instance = this;
 }
예제 #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();
            }
        }
예제 #3
0
 public void StarshipChecker_Returns_False_If_Invalid_Name_Is_Entered()
 {
     Assert.False(ShipChecker.TestIfShipIsInStarWars(StarshipFetcher.GetListOfStarships(), "Centennial Screechbird"));
 }
예제 #4
0
 public void StarshipChecker_Returns_True_If_Valid_Name_Is_Entered()
 {
     Assert.True(ShipChecker.TestIfShipIsInStarWars(StarshipFetcher.GetListOfStarships(), "Millennium Falcon"));
 }