public void AddADoor_ShouldBeTrue() { Assert.IsTrue(_repo.AddADoor(_badge.BadgeId, "A4")); }
private void EditBadge() { Console.Clear(); ListBadges(); Console.WriteLine("Enter the ID of the badge you'd like to edit."); int originalBadgeId = int.Parse(Console.ReadLine()); Console.WriteLine("What would you like to do with the badge? Enter the corresponding number below:\n" + "1. Remove a door\n" + "2. Remove all doors\n" + "3. Add a door\n"); switch (Console.ReadLine()) { case "1": Console.WriteLine("Enter the door you'd like to remove."); string removeADoor = Console.ReadLine().ToUpper(); bool doorWasRemoved = _badgeRepo.RemoveADoor(originalBadgeId, removeADoor); if (doorWasRemoved) { Console.WriteLine($"The door {removeADoor} has been successfully removed from badge ID {originalBadgeId}."); } else { Console.WriteLine($"The door {removeADoor} could not be removed from badge ID {originalBadgeId}."); } break; case "2": bool doorsWereRemoved = _badgeRepo.RemoveAllDoors(originalBadgeId); if (doorsWereRemoved) { Console.WriteLine($"All doors have been successfully removed from {originalBadgeId}."); } else { Console.WriteLine($"The doors could not be removed from {originalBadgeId}."); } break; case "3": Console.WriteLine("Enter the door you'd like to add."); string addADoor = Console.ReadLine().ToUpper(); bool doorWasAdded = _badgeRepo.AddADoor(originalBadgeId, addADoor); if (doorWasAdded) { Console.WriteLine($"The door {addADoor} has been successfully added to badge ID {originalBadgeId}."); } else { Console.WriteLine($"The door {addADoor} could not be added to badge ID {originalBadgeId}."); } break; default: Console.WriteLine("I didn't understand your entry. You'll be returned to the main menu."); break; } }