Exemple #1
0
        private async Task <IEnumerable <User> > GetFollowers()
        {
            var followers = await instaApi.GetFollowersAsync(loggedUser.UserId);

            var followersForList = FormatFollowers(followers);

            return(followersForList);
        }
Exemple #2
0
        public async Task GetFollowers_Returns_List_Of_Followers()
        {
            var returnedFollowers = new Result <InstaUserShortList>(true, new InstaUserShortList());
            var expectedFollowers = new List <User>();
            var userProcessor     = new Mock <IUserProcessor>();

            userProcessor.Setup(p => p.GetUserFollowersByIdAsync(userId, It.IsAny <PaginationParameters>(), It.IsAny <string>(), It.IsAny <bool>()))
            .ReturnsAsync(returnedFollowers);
            instaApi.Setup(a => a.UserProcessor).Returns(userProcessor.Object);

            var result = await subject.GetFollowersAsync(userId);

            Assert.AreEqual(expectedFollowers, result);
        }