Ejemplo n.º 1
0
        //methods won't return anything- 11
        //Add a new badge
        public void AddNewBadge()
        {
            Console.Clear();
            EmployeeBadge newEmployeeBadge = new EmployeeBadge();

            //declare it (newemployeebadge) first above so we can call the property below
            //BadgeID
            Console.WriteLine("What is the number on the badge:");
            string idAsString = Console.ReadLine();
            int    idAsInt    = int.Parse(idAsString);

            //DoorNames
            Console.WriteLine("List a door that it needs access to:");
            string doorNames = Console.ReadLine();

            Console.WriteLine("Any other doors (y/n)?");
            string inputAnswer = Console.ReadLine();

            while (inputAnswer == "y")
            {
                Console.WriteLine("List a door that it needs access to:");
                string inputDoorNames = Console.ReadLine();

                Console.WriteLine("Any other doors (y/n)?");
            }

            if (inputAnswer == "n")
            {
                Console.WriteLine("Press any key to continue.");
                Console.ReadKey();
            }
            //13
            _badgeRepo.AddBadgeToList(newEmployeeBadge);
        }
Ejemplo n.º 2
0
        public void AddBadgeToList()
        //Arrange
        {
            List <string> doorNames = new List <string>();
            EmployeeBadge badge     = new EmployeeBadge(12345, doorNames, "Erica");

            //Act
            item.AddBadgeToList(badge);

            //Assert
            int expected = 1;
            int actual   = item.GetBadgeList().Count;

            Assert.AreEqual(expected, actual);
        }