Esempio n. 1
0
        public void testAddFollow()
        {
            followList list = new followList();
            User       u1   = new User(1, "Shafer", "Hess", "shafer_", "*****@*****.**", "testPass");

            list.addFollow(u1);

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

            Assert.Equal(u1.getUsername(), userList[0].getUsername());
        }
Esempio n. 2
0
        public void testGetUser()
        {
            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);

            User newUser = list.getUser(u1);

            Assert.Equal(u1.getUsername(), newUser.getUsername());
        }
Esempio n. 3
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());
        }
Esempio n. 4
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());
        }