Example #1
0
        public void GetAllBadges_ShouldReturnAll()
        {
            Badges     allBadges     = new Badges();
            BadgesRepo allBadgesRepo = new BadgesRepo();

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

            _repoBadge.CreateNewBadge(_badges.BadgeID, _badges);
        }
        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);
        }
Example #4
0
        public void AddBadgeToDirectory_ShouldAddBadge()
        {
            Badges     addBadge  = new Badges();
            BadgesRepo _addBadge = new BadgesRepo();
            bool       addResult = _addBadge.AddBadgeToDictionary(addBadge);

            Assert.IsTrue(addResult);
        }
 public void Arrange()
 {
     _repo  = new BadgesRepo();
     _badge = new Badges(3345, new List <string> {
         "C3", "B7", "D1"
     });
     _repo.AddBadgeToDictionary(_badge);
 }
Example #6
0
        public void Initialize()
        {
            List <string> listofDoor = new List <string>();

            listofDoor.Add("Door 01");
            _repo = new BadgesRepo();
            badge = new Badge(01, listofDoor);
        }
Example #7
0
        public void AddBadgeToCollection_ShouldReturnTrue()
        {
            var repo  = new BadgesRepo();
            var badge = new Badge();

            bool wasAdded = repo.AddBadgeToCollection(badge);

            Assert.IsTrue(wasAdded);
        }
        public void Arrange()
        {
            _repo    = new BadgesRepo();
            _content = new BadgesPOCOs(12345, new List <DoorAccess> {
                DoorAccess.A3, DoorAccess.A5
            });

            _repo.AddNewBadge(_content);
        }
        public void AddNewBadge()
        {
            BadgesPOCOs content    = new BadgesPOCOs();
            BadgesRepo  repository = new BadgesRepo();

            bool addResult = repository.AddNewBadge(content);

            Assert.IsTrue(addResult);
        }
Example #10
0
        public void DoesListContainID_ShouldReturnFalse()
        {
            BadgesRepo repo  = new BadgesRepo();
            Badge      badge = new Badge();

            bool doesContain = repo.DoesListContainBadgeID(badge);

            Assert.IsFalse(doesContain);
        }
Example #11
0
        public void TestingUpdate()
        {
            BadgesRepo badgeRepo = new BadgesRepo();
            Badges     testBadge = new Badges(1, "C4");

            bool changedResult = badgeRepo.UpdateBadge(2, testBadge);

            Assert.IsTrue(changedResult);
        }
        public void AddToDictionary_ShouldReturnTrue()
        {
            Badges     badge = new Badges();
            BadgesRepo repo  = new BadgesRepo();

            bool wasAdded = repo.AddBadgeToDictionary(badge);

            Assert.IsTrue(wasAdded);
        }
Example #13
0
        public void Arrange()
        {
            List <string> listOfDoors = new List <string>();

            _repo   = new BadgesRepo();
            _badges = new Badges(1, listOfDoors);

            _repo.AddBadgeToDictionary(_badges);
        }
Example #14
0
 public void TestBadge()
 {
     _badge = new Badge(2127, new List <string>
     {
         "A5", "A7", "A8"
     });
     _badgesRepo = new BadgesRepo();
     _badgesRepo.AddBadge(_badge);
 }
Example #15
0
        public void DisplayBadgeID()
        {
            var repo  = new BadgesRepo();
            var badge = new Badge(1, new List <string>());

            repo.AddBadgeToCollection(badge);
            int displayID = repo.DisplayBadgeID(1);

            Assert.IsNotNull(displayID);
        }
Example #16
0
        public void GetThisPartyStarted()
        {
            _repo   = new BadgesRepo();
            _badges = new BadgesPoco(1150, new List <string>()
            {
                "A1"
            });

            _repo.AddNewBadge(_badges);
        }
Example #17
0
        public void DoesListContainID_ShouldReturnTrue()
        {
            BadgesRepo repo  = new BadgesRepo();
            Badge      badge = new Badge();

            repo.AddBadgeToCollection(badge);
            bool doesContain = repo.DoesListContainBadgeID(badge);

            Assert.IsTrue(doesContain);
        }
        public void NewBadge_ShouldReturnTrue()
        {
            Badges     test = new Badges();
            BadgesRepo repo = new BadgesRepo();


            bool wasAdded = repo.NewBadge(test);

            Assert.IsTrue(wasAdded);
        }
Example #19
0
        public void AddBadgeAccess_ShouldReturnTrue()
        {
            var repo  = new BadgesRepo();
            var badge = new Badge(1, new List <string>());

            repo.AddBadgeToCollection(badge);
            bool wasAdded = repo.AddBadgeAccess(1, "A1");

            Assert.IsTrue(wasAdded);
        }
Example #20
0
        public void GetAllBadges_ShouldReturnNotNull()
        {
            var repo  = new BadgesRepo();
            var badge = new Badge(1, new List <string>());

            repo.AddBadgeToCollection(badge);
            Dictionary <int, Badge> getBadges = repo.GetAllBadges();

            Assert.IsNotNull(getBadges);
        }
Example #21
0
        public void DisplayBadgeAccess()
        {
            var repo  = new BadgesRepo();
            var badge = new Badge(1, new List <string>());

            repo.AddBadgeToCollection(badge);
            repo.AddBadgeAccess(1, "A1");
            string displayAccess = repo.DisplayBadgeAccess(1);

            Assert.IsNotNull(displayAccess);
        }
        public void AccessDoor_ShouldReturnTrue()
        {
            Badges     test = new Badges();
            BadgesRepo repo = new BadgesRepo();


            bool wasAdded = repo.AccessDoor(test);


            Assert.IsTrue(wasAdded);
        }
        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);
        }
Example #24
0
        public void Arrange()
        {
            List <string> list1 = new List <string>();  // Need to create a lis

            list1.Add("Room 4");

            var badge1 = new Badges(1, list1);

            _repo = new BadgesRepo();
            _repo.AddToAccessList(badge1);
        }
Example #25
0
        //View or show
        public void ShowListWithBadges()
        {
            //Arange
            BadgesRepo badgesRepo = new BadgesRepo();

            //Act
            Dictionary <int, Badge> listFromRepo = badgesRepo.GetAllBadges();

            //Assert
            Assert.IsNotNull(badgesRepo);
        }
Example #26
0
        public void CheckAssignedBadgeAccess_ShouldReturnFalse()
        {
            var    repo       = new BadgesRepo();
            var    badge      = new Badge(1, new List <string>());
            string doorAccess = "A5";

            repo.AddBadgeToCollection(badge);
            repo.AddBadgeAccess(1, "A1");
            bool doesContain = repo.CheckAssignedBadgeAccess(1, doorAccess);

            Assert.IsFalse(doesContain);
        }
Example #27
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 #28
0
 public void Arrange()
 {
     _repo        = new BadgesRepo();
     _newBadgeOne = new Badges(322, new List <string> {
         "A3", "B2", "N8"
     });
     _newBadgeTwo = new Badges(12, new List <string> {
         "A4", "A3", "B1"
     });
     _repo.AddBadgeToDictionary(_newBadgeOne);
     _repo.AddBadgeToDictionary(_newBadgeTwo);
 }
Example #29
0
        public void AddBadge_AreEqual()
        {
            // Arrange
            Badge      badge     = new Badge(1);
            BadgesRepo badgeRepo = new BadgesRepo();
            SortedDictionary <int, List <string> > _dictionaryBadge = new SortedDictionary <int, List <string> >();

            // Act
            badgeRepo.AddBadge(badge);
            int number = badgeRepo.GetAllBadges().Count;

            // Assert
            Assert.AreEqual(1, number);
        }
Example #30
0
        public void Arrange()
        {
            _repo = new BadgesRepo();

            List <string> doors1 = new List <string>();

            doors1.Add("A1");
            doors1.Add("A2");
            doors1.Add("A3");

            _content = new Badge(5001, doors1);

            _repo.AddToAccessList(_content);
        }