Exemplo n.º 1
0
        public async Task GetFollowers_UserHasAtLeast100Followers_ReturnsOneLevelFollowers()
        {
            var followerLogic = new FollowerLogic(_mapper, new OneHundredFollowersRequest());

            List <User> result = await followerLogic.GetFollowers("");

            Assert.That(result.Count == 100);
            Assert.That(result.TrueForAll(user => user.Followers.Count == 0));//no second level
        }
Exemplo n.º 2
0
        public async Task GetFollowers_MaxReachedOnLevelTwo_ReturnTwoLevels()
        {
            var followerLogic = new FollowerLogic(_mapper, new TwoLevelRequest());

            List <User> result = await followerLogic.GetFollowers("");

            Assert.That(result.Count == 1);
            Assert.That(result[0].Followers.Count == 99);
            Assert.That(result[0].Followers.TrueForAll(user => user.Followers.Count == 0));//no third level
        }
Exemplo n.º 3
0
        public async Task GetFollowers_MaxNotReached_ReturnFourLevels()
        {
            var followerLogic = new FollowerLogic(_mapper, new FourLevelRequest());

            List <User> result = await followerLogic.GetFollowers("");

            Assert.That(result.Count == 1);
            Assert.That(result[0].Followers.Count == 1);
            Assert.That(result[0].Followers[0].Followers.Count == 1);
            Assert.That(result[0].Followers[0].Followers[0].Followers.Count == 1); //4th level exists
            Assert.That(
                result[0].Followers[0].Followers[0].Followers.TrueForAll(user => user.Followers.Count == 0)
                );
        }