Пример #1
0
        public void AddABadge()
        {
            Console.Clear();
            Badge newBadge = new Badge();

            Console.WriteLine("Please input the Badge ID for this Badge");
            newBadge.BadgeID = int.Parse(Console.ReadLine());
            Console.WriteLine("Input a door that this badge needs access to:");
            newBadge.DoorNames.Add(Console.ReadLine().ToUpper());
            bool anyOtherDoors = true;

            while (anyOtherDoors)
            {
                Console.WriteLine("Are there any other doors that this badge needs access to (y/n):");
                if (Console.ReadLine().ToLower() == "n")
                {
                    anyOtherDoors = false;
                }
                else if (Console.ReadLine().ToLower() == "y")
                {
                    Console.WriteLine("Input a door that this badge needs access to:");
                    newBadge.DoorNames.Add(Console.ReadLine().ToUpper());
                }
            }
            BadgesRepo.CreateBadge(newBadge.BadgeID, newBadge);
        }
Пример #2
0
        public void Arrange()
        {
            _repo = new BadgesRepo();
            List <string> doors = new List <string> {
                "A367", "B59", "C423"
            };

            _badge = new Badge(46783, doors);

            _repo.CreateBadge(_badge.BadgeID, _badge);
        }