public void Arrange()
 {
     _repo   = new BadgesRepository();
     _badges = new Badges(new List <string> {
         "A1", "A3", "A6"
     });
     _repo.AddABadge(_badges);
 }
 public void CArrange()
 {
     _repository = new BadgesRepository();
     _content    = new BadgesContent(12345, new List <DoorNames> {
         DoorNames.A3, DoorNames.B2
     });
     _repository.AddNewBadgeToDictionary(_content);
 }
Пример #3
0
 public void ArrangeItem()
 {
     _repo  = new BadgesRepository();
     _badge = new Badges(1, new List <string> {
         "A1"
     });
     _repo.CreateNewBadge(_badge.BadgeID, _badge.DoorName);
 }
Пример #4
0
        public void AddDoor_ReturnBoolean()
        {
            BadgesRepository repo = new BadgesRepository();

            _repo.AddDoor(1, "A3");
            bool wasDoorAdded = _repo.AddDoor(1, "A3");

            Assert.IsTrue(wasDoorAdded);
        }
Пример #5
0
        public void AddBadge_ShouldReturnTrue()
        {
            Badge            badge      = new Badge();
            BadgesRepository repository = new BadgesRepository();

            bool addBadge = repository.AddBadge(badge);

            Assert.IsTrue(addBadge);
        }
Пример #6
0
        public void CreateNewBadge_CorrectBoolean()
        {
            int              badge = 3;
            List <string>    door  = new List <string>();
            BadgesRepository repo  = new BadgesRepository();

            bool wasAddedCorrectly = repo.CreateNewBadge(badge, door);

            Assert.IsTrue(wasAddedCorrectly);
        }
        public void AddNewBadgeToDictionaryTest()
        {
            List <DoorNames> doorNameList = new List <DoorNames>();
            BadgesContent    badge        = new BadgesContent();
            BadgesRepository repository   = new BadgesRepository();

            bool addBadge = repository.AddNewBadgeToDictionary(badge);

            Assert.IsTrue(addBadge);
        }
Пример #8
0
        public void Arrange()
        {
            _repo = new BadgesRepository();
            List <string> _list = new List <string> {
                "A1", "A2", "A3"
            };

            _badge = new Badges(123, _list);

            _repo.AddBadge(_badge);
        }
Пример #9
0
        public void ListBadges_ShouldReturnBadgeDatabase()
        {
            Badge            badge      = new Badge();
            BadgesRepository repository = new BadgesRepository();

            repository.AddBadge(badge);

            Dictionary <int, Badge> badges = repository.ListBadges();

            bool dictionaryHasBadges = badges.ContainsKey(badge.BadgeID);
        }
Пример #10
0
        public void Arrange()
        {
            _repo = new BadgesRepository();
            List <string> doors = new List <string>()
            {
                "A7"
            };

            _badge = new Badges(12345, doors);
            _repo.AddBadge(_badge);
        }
Пример #11
0
        public void AddBadge_ShouldBeTrue()
        {
            BadgesRepository repo  = new BadgesRepository();
            List <string>    doors = new List <string>()
            {
                "A7"
            };
            Badges badge    = new Badges(12345, doors);
            bool   addBadge = repo.AddBadge(badge);

            Assert.IsTrue(addBadge);
        }
        public void TestMethod1()
        {
            BadgesRepository MyBadges = new BadgesRepository();

            string check1 = MyBadges.CreateDataBase("", "");
            string check2 = MyBadges.ReadFromDataBase();
            string check3 = MyBadges.DeleteDataBase();

            Assert.IsNotNull(MyBadges.CreateDataBase("", ""));
            Assert.AreEqual("read", check2);
            Assert.AreEqual("deleted", check3);
        }
Пример #13
0
        public void SeeBadgeByID_ReturnKeyList()
        {
            List <string>    door = new List <string>();
            BadgesRepository repo = new BadgesRepository();

            repo.CreateNewBadge(3, door);

            Dictionary <int, List <string> > dict = repo.GetBadgeAccess();

            bool DictHasDoor = dict.ContainsValue(door);

            Assert.IsTrue(DictHasDoor);
        }
Пример #14
0
        public void GetBadgeByID_ShouldReturnCorrectBadge()
        {
            Badge badge = new Badge(1, new List <Doors> {
                Doors.A1
            });
            BadgesRepository repository = new BadgesRepository();

            repository.AddBadge(badge);

            Badge searchBadge = repository.GetBadgeByID(1);

            Assert.AreEqual(badge.BadgeID, searchBadge.BadgeID);
        }
Пример #15
0
        public void GetBadgeAccess_ReturnDictionary()
        {
            int              badge = 3;
            List <string>    door  = new List <string>();
            BadgesRepository repo  = new BadgesRepository();

            repo.CreateNewBadge(3, door);

            Dictionary <int, List <string> > dict = repo.GetBadgeAccess();

            bool DictHasBadge = dict.ContainsKey(badge);

            Assert.IsTrue(DictHasBadge);
        }
Пример #16
0
        public void AddBadge_ShouldGetNotNull()
        {
            //Arrange
            Badges badge = new Badges();

            badge.BadgeID = 123;
            BadgesRepository repo = new BadgesRepository();

            //Act
            repo.AddBadge(badge);
            Badges badgeFromDirectory = repo.

                                        //Assert
                                        Assert.IsNotNull(badgeFromDirectory);
        }
Пример #17
0
        public void DeleteBadge_ShouldReturnTrue()
        {
            Badge badge = new Badge(1, new List <Doors> {
                Doors.A1
            });
            BadgesRepository repository = new BadgesRepository();

            repository.AddBadge(badge);

            Badge getBadge = repository.GetBadgeByID(1);

            bool removeBadge = repository.DeleteBadge(getBadge);

            Assert.IsTrue(removeBadge);
        }
Пример #18
0
        public void GetAllBadges_ShouldBeTrue()
        {
            Dictionary <int, List <string> > badges = _repo.ShowAllBadges();
            bool containsKey = badges.ContainsKey(12345);

            Assert.IsTrue(containsKey);

            BadgesRepository repo  = new BadgesRepository();
            List <string>    doors = new List <string>()
            {
                "A7"
            };
            Badges badge    = new Badges(12345, doors);
            bool   addBadge = repo.AddBadge(badge);

            Dictionary <int, List <string> > valuePairs = repo.ShowAllBadges();
            bool contains = valuePairs.TryGetValue(12345, out doors);

            Assert.IsTrue(contains);
        }
Пример #19
0
 public void Arrange()
 {
     _repo   = new BadgesRepository();
     _badges = new Badges(123, )
 }