Example #1
0
        public Task <ITwitterResult <IIdsCursorQueryResultDTO> > GetFriendIds(IGetFriendIdsParameters parameters, ITwitterRequest request)
        {
            var query = _userQueryGenerator.GetFriendIdsQuery(parameters);

            request.Query.Url        = query;
            request.Query.HttpMethod = HttpMethod.GET;

            return(_twitterAccessor.ExecuteRequest <IIdsCursorQueryResultDTO>(request));
        }
Example #2
0
        public async Task GetFriendIds_ReturnsUserDTOAsync()
        {
            // Arrange
            var queryExecutor  = CreateUserQueryExecutor();
            var request        = A.Fake <ITwitterRequest>();
            var url            = TestHelper.GenerateString();
            var parameter      = new GetFriendsParameters(42);
            var expectedResult = A.Fake <ITwitterResult <IIdsCursorQueryResultDTO> >();

            A.CallTo(() => _fakeUserQueryGenerator.GetFriendIdsQuery(parameter)).Returns(url);
            A.CallTo(() => _fakeTwitterAccessor.ExecuteRequestAsync <IIdsCursorQueryResultDTO>(request)).Returns(expectedResult);

            // Act
            var result = await queryExecutor.GetFriendIdsAsync(parameter, request);

            // Assert
            Assert.Equal(result, expectedResult);
            Assert.Equal(request.Query.Url, url);
            Assert.Equal(HttpMethod.GET, request.Query.HttpMethod);
        }
Example #3
0
        // Friend ids
        public IEnumerable <long> GetFriendIds(IUserIdentifier user, int maxFriendsToRetrieve)
        {
            string query = _userQueryGenerator.GetFriendIdsQuery(user, maxFriendsToRetrieve);

            return(_twitterAccessor.ExecuteCursorGETQuery <long, IIdsCursorQueryResultDTO>(query, maxFriendsToRetrieve));
        }
Example #4
0
        // Friend ids
        public IEnumerable <long> GetFriendIds(IUserIdentifier userDTO, int maxFriendsToRetrieve)
        {
            string query = _userQueryGenerator.GetFriendIdsQuery(userDTO, maxFriendsToRetrieve);

            return(ExecuteGetUserIdsQuery(query, maxFriendsToRetrieve));
        }
        public IEnumerable <string> GetFriendIds(IUserIdDTO userDTO, int maxFriendsToRetrieve = 5000)
        {
            string query = _userQueryGenerator.GetFriendIdsQuery(userDTO, maxFriendsToRetrieve);

            return(_twitterAccessor.ExecuteJsonCursorGETQuery <IIdsCursorQueryResultDTO>(query));
        }