public void RevokeToyFromChild() { //arrange Child kid = _book.AddChild("Terell"); Toy toy = _register.Add("Silly Putty", kid); //act _register.RevokeToy(toy); List <Toy> toysForTerell = _register.GetToysForChild(kid); //assert Assert.DoesNotContain(toy, toysForTerell); }
public static void DoAction(SantasToyBag bag, SantasNiceList book) { var kid = KidsMenu.Show(book); var toys = bag.GetToysForChild(kid).ToArray(); foreach (var toy in toys) { Console.WriteLine($"{Array.IndexOf(toys, toy) + 1}. {toy.name}"); } Console.Write("> "); var toyChoice = Console.ReadLine(); var chosenToy = toys[int.Parse(toyChoice) - 1]; bag.RevokeToy(chosenToy); }