public void DeleteDoorFromExistingBadge() { // Arrange // Act _repo.RemoveDoorFromBadge(_badge.BadgeID, "A5"); // Assert Assert.IsTrue(_badge.Doors.Count == 1); }
private void UpdateABadge() { Badge newBadge = new Badge(); Console.Clear(); // Ask for the Badge ID of the badge we want to update Console.WriteLine("What is the badge number to update?"); // Get that badge string oldBadge = Console.ReadLine(); newBadge.BadgeID = int.Parse(oldBadge); KeyValuePair <int, List <string> > dictionaryBadge = _badgeRepo.GetBadgeByBadgeID(newBadge.BadgeID); string badgeKeyValuePair = string.Join(", ", dictionaryBadge.Value); Console.WriteLine(dictionaryBadge.Key + " has access to " + badgeKeyValuePair) ; Console.WriteLine("What would you like to do?\n\n" + "1. Remove a door.\n" + "2. Add a door."); string input = Console.ReadLine(); if (input == "1") { Console.WriteLine("Which door would you like to remove?"); string door = Console.ReadLine(); _badgeRepo.RemoveDoorFromBadge(newBadge.BadgeID, door); } else { Console.WriteLine("Which door would you like to add?"); string door = Console.ReadLine(); // Verify the update worked _badgeRepo.UpdateDoorToBadge(newBadge.BadgeID, door); } }