예제 #1
0
        private void RemoveDoor()
        {
            Console.Clear();
            DisplayAllBadges();
            Console.WriteLine("REMOVE DOOR \n" +
                              "\n" +
                              "Please type the badge ID# that you would like to update. \n");
            int userInput = int.Parse(Console.ReadLine());

            Console.Clear();
            Badges badge = _badgesRepo.GetBadgeByID(userInput);

            ShowBadge(badge);
            Console.WriteLine("Which door would you like to remove?");
            string doorToRemove = Console.ReadLine();

            if (badge.DoorNames.Contains(doorToRemove))
            {
                _badgesRepo.DeleteExistingRoom(userInput, doorToRemove);
                Console.WriteLine("Door removed.");
            }
            else
            {
                Console.WriteLine("You entered an invalid response. No change was recorded for this badge.");
            }
            Console.WriteLine("Press any key to return to the main menu.");
            Console.ReadKey();
        }
예제 #2
0
        public void DeleteExistingRoom_ShouldDeleteRoom()
        {
            bool deleteARoom = _repo.DeleteExistingRoom(12, "A3");

            Assert.IsTrue(deleteARoom);
        }