public void EditParty()
        {
            Console.Write("Enter the date of the party to update: ");
            DateTime updateDate = DateTime.Parse(Console.ReadLine());

            Console.Write("Enter the type of booth to update (burger or treat): ");
            string boothType = Console.ReadLine();

            if (boothType.ToLower() == "burger")
            {
                Console.Write("Enter the number of hamburger tickets taken: ");
                int hamburgerTickets = int.Parse(Console.ReadLine());
                Console.Write("Enter the number of veggie burger tickets taken: ");
                int veggieBurgerTickets = int.Parse(Console.ReadLine());
                Console.Write("Enter the number of hot dog tickets taken: ");
                int         hotdogTickets     = int.Parse(Console.ReadLine());
                BurgerBooth updateBurgerBooth = new BurgerBooth(hamburgerTickets, veggieBurgerTickets, hotdogTickets);
                _partyRepo.UpdateBooth(updateDate, updateBurgerBooth, boothType);
            }
            else if (boothType.ToLower() == "treat")
            {
                Console.Write("Enter the number of ice cream tickets taken: ");
                int iceCreamTickets = int.Parse(Console.ReadLine());
                Console.Write("Enter the number of popcorn tickets taken: ");
                int        popcornTickets   = int.Parse(Console.ReadLine());
                TreatBooth updateTreatBooth = new TreatBooth(iceCreamTickets, popcornTickets);
                _partyRepo.UpdateBooth(updateDate, updateTreatBooth, boothType);
            }
            Console.WriteLine("Party updated\n" +
                              "Press any key to continue...");
            Console.ReadKey();
        }
Exemplo n.º 2
0
        public void UpdateBoothTest()
        {
            TreatBooth newTreatBooth = new TreatBooth(99, 45);

            _partyTestList.UpdateBooth(new DateTime(2019, 6, 15), newTreatBooth, "treat");

            Booth      updatedBooth = _partyTestList.GetBooth(new DateTime(2019, 6, 15), "treat");
            TreatBooth actual       = (TreatBooth)updatedBooth;

            Assert.AreEqual(99, actual.IceCreamTickets);
            Assert.AreEqual(45, actual.PopcornTickets);
        }