public Task <ITwitterResult <IUserDTO> > UnmuteUser(IUnmuteUserParameters parameters, ITwitterRequest request) { var query = _userQueryGenerator.GetUnmuteUserQuery(parameters); request.Query.Url = query; request.Query.HttpMethod = HttpMethod.POST; return(_twitterAccessor.ExecuteRequest <IUserDTO>(request)); }
public async Task UnmutedUser_ReturnsUserDTOAsync() { // Arrange var queryExecutor = CreateUserQueryExecutor(); var url = TestHelper.GenerateString(); var parameters = new UnmuteUserParameters(42); var request = A.Fake <ITwitterRequest>(); var expectedResult = A.Fake <ITwitterResult <IUserDTO> >(); A.CallTo(() => _fakeUserQueryGenerator.GetUnmuteUserQuery(parameters)).Returns(url); A.CallTo(() => _fakeTwitterAccessor.ExecuteRequestAsync <IUserDTO>(request)).Returns(expectedResult); // Act var result = await queryExecutor.UnmuteUserAsync(parameters, request); // Assert Assert.Equal(result, expectedResult); Assert.Equal(request.Query.Url, url); Assert.Equal(HttpMethod.POST, request.Query.HttpMethod); }