Example #1
0
        public Task <ITwitterResult <IIdsCursorQueryResultDTO> > GetMutedUserIds(IGetMutedUserIdsParameters parameters, ITwitterRequest request)
        {
            var query = _userQueryGenerator.GetMutedUserIdsQuery(parameters);

            request.Query.Url        = query;
            request.Query.HttpMethod = HttpMethod.GET;
            return(_twitterAccessor.ExecuteRequest <IIdsCursorQueryResultDTO>(request));
        }
Example #2
0
        public async Task GetMutedUserIds_ReturnsUserIdsAsync()
        {
            // Arrange
            var queryExecutor = CreateUserQueryExecutor();

            var url            = TestHelper.GenerateString();
            var parameters     = new GetMutedUserIdsParameters();
            var request        = A.Fake <ITwitterRequest>();
            var expectedResult = A.Fake <ITwitterResult <IIdsCursorQueryResultDTO> >();

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

            // Act
            var result = await queryExecutor.GetMutedUserIdsAsync(parameters, request);

            // Assert
            Assert.Equal(result, expectedResult);
            Assert.Equal(request.Query.Url, url);
            Assert.Equal(HttpMethod.GET, request.Query.HttpMethod);
        }