public async Task RefreshAsync_Always_RefreshesToken() { //Arrange var sut = CreateSut(); var response = new Mock <IHttpResponse <JwtTokenDto> >(); var tokenDto = new JwtTokenDto(Token, ""); Mocker.GetMock <IHttpClient>() .Setup(o => o. GetAsync <JwtTokenDto>(AuthenticationUrls.Refresh(Token, Email))) .ReturnsAsync(response.Object); Mocker.GetMock <IProxyHelper>() .Setup(o => o.ProcessResponseAsync(response.Object, sut)) .ReturnsAsync(tokenDto); //Act await sut.RefreshAsync(Token, Email); //Assert Mocker.GetMock <IProxyHelper>() .Verify(o => o.ProcessResponseAsync(response.Object, sut)); }
public AuthenticationUrlsTestsFixture() { IdentityServerConfiguration = new Mock <IOidcConfiguration>(); AuthenticationService = new Mock <IAuthenticationService>(); AuthenticationUrls = new AuthenticationUrls(IdentityServerConfiguration.Object, AuthenticationService.Object); }
public async Task <JwtTokenDto> RefreshAsync(string refreshToken, string email) { var result = await _httpClient.GetAsync <JwtTokenDto>(AuthenticationUrls.Refresh(refreshToken, email)); return(await _proxyHelper.ProcessResponseAsync(result, this)); }