Example #1
0
        public void CreateNewBadge()
        {
            Console.Clear();

            int           badgeId = 0;
            List <string> doors   = new List <string>();

            Console.WriteLine("What is the badge number?");
            badgeId = int.Parse(Console.ReadLine());

            Console.WriteLine("Please advise the door that this badge can access?");
            string doorInput = Console.ReadLine();

            doors.Add(doorInput);

            Console.WriteLine("Your door access has been added");
            Console.WriteLine("Do you waned to add another door?\n" +
                              "Enter y for Yes\n" +
                              "Enter n for No");
            string userInput = Console.ReadLine().ToLower();

            if (userInput == "y")
            {
                CreateNewBadge();
            }
            else
            {
                Console.WriteLine("Press any key to return to the menu...");
                Console.ReadLine();
            }
            Console.ReadKey();
            BadgesContent newBadge = new BadgesContent(badgeId, doors);

            _repo.CreateNewBadge(newBadge);
        }
Example #2
0
        public void BadgesArranged()
        {
            _repoBadge = new BadgesRepo();
            _badges    = new Badges(1, "front, back");

            _repoBadge.CreateNewBadge(_badges.BadgeID, _badges);
        }
Example #3
0
        public void CreateNewBadge_Test()
        {
            //arrange
            BadgesContent content = new BadgesContent();

            //act
            bool addBadge = _repo.CreateNewBadge(content);

            //assert
            Assert.IsTrue(addBadge);
        }
Example #4
0
        public void CreateNewBadge_NotNull()
        {
            Badges badges = new Badges();

            badges.BadgeID = 4;
            BadgesRepo repo = new BadgesRepo();

            repo.CreateNewBadge(_badges.BadgeID, badges);
            Badges badgesFromDictionary = repo.SearchBadgeID(4);

            Assert.IsNotNull(badgesFromDictionary);
        }
Example #5
0
        private void CreateNewBadge()
        {
            Console.Clear();
            Badges newBadge = new Badges();

            Console.WriteLine("Enter the badge ID number associated with the new badge: ");
            string badgeIDAsString = Console.ReadLine();

            newBadge.BadgeID = int.Parse(badgeIDAsString);
            Console.WriteLine("What door needs to be accessed with the new badge (include multiple if necessary)?");
            newBadge.DoorNames = Console.ReadLine();

            _badgesRepo.CreateNewBadge(newBadge.BadgeID, newBadge);
        }