Пример #1
0
        public void testRemoveFollow()
        {
            followList list = new followList();
            User       u1   = new User(1, "Shafer", "Hess", "shafer_", "*****@*****.**", "testPass");
            User       u2   = new User(2, "Test", "User", "tester_", "*****@*****.**", "password");

            list.addFollow(u1);
            list.addFollow(u2);

            list.removeFollow(u1);

            List <User> userList = list.getUserList();

            int size = userList.Count;

            Assert.Equal(1, size);
            Assert.Equal(1, list.getFollows());
            Assert.Equal(u2.getUsername(), userList[0].getUsername());
        }
Пример #2
0
        public void testGetAndSetFollows()
        {
            //Test getFollows()
            followList list = new followList();
            User       u1   = new User(1, "Shafer", "Hess", "shafer_", "*****@*****.**", "testPass");
            User       u2   = new User(2, "Test", "User", "tester_", "*****@*****.**", "password");

            list.addFollow(u1);
            list.addFollow(u2);

            int follows = list.getFollows();

            Assert.Equal(2, follows);

            //Test setFollows()
            followList list2 = new followList();

            list2.setFollows(20);

            Assert.Equal(20, list2.getFollows());
        }