Exemple #1
0
        public void TestMethod_GetBadges()
        {
            //Arrange -> Set things up.
            List <string> doorName1 = new List <string> {
                "A1", "A2", "J1"
            };
            Badges badges1 = new Badges(2, doorName1); // need to fill in parameters

            List <string> doorName2 = new List <string> {
                "A1", "A2", "T1"
            };
            Badges badges2  = new Badges(3, doorName2); // need to fill in parameters
            int    expected = 3;

            //Act - Do some work
            _kIRepo.AddToDictionary(badges2);
            _kIRepo.AddToDictionary(badges1);
            //Assert check to see if the work is working
            Assert.AreEqual(expected, _kIRepo.GetBadges().Count);
        }
Exemple #2
0
 public void Arrange()
 {
     //Arrange -> Set things up.
     //Check with Terry to be sure I am using the right Ref. of _o3_KomodoInsuranceRepo of
     _kIRepo  = new KomodoInsuranceRepo();
     doorName = new List <string> {
         "A1", "A2", "333"
     };
     badges = new Badges(1, doorName); // need to fill in parameters
     _kIRepo.AddToDictionary(badges);
 }
Exemple #3
0
        private void AddABadge()
        {
            //clear console
            Console.Clear();

            //create A new Badge
            Badges badge = new Badges();

            //ask user for badge id
            Console.WriteLine("Please enter the badge Id");
            int userInput = int.Parse(Console.ReadLine());

            //Make an Assignment to badge
            badge.BadgeId = userInput;

            //make a bool that will terminate the upcomming while loop
            bool hasEnteredAllDoors = false;

            while (hasEnteredAllDoors == false)
            {
                //ask user if they want to add a door name
                Console.WriteLine("Would you like to add a door name? y/n");
                string inputAnswer = Console.ReadLine();

                if (inputAnswer == "Y" || inputAnswer == "y")
                {
                    //ask user to input Door name
                    Console.WriteLine("Please enter the door name");
                    string inputDoorName = Console.ReadLine();

                    badge.DoorNames.Add(inputDoorName);
                }
                if (inputAnswer == "N" || inputAnswer == "n")
                {
                    hasEnteredAllDoors = true;
                }
            }
            _dictRepo.AddToDictionary(badge);
        }