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 }
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 }
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) ); }