public async Task <IApprenticeshipLevyApiClient> GetLevyHttpClient() { var tokenService = new TokenServiceApiClient(_levySubmissionsApiConfiguration); var tokenResult = await tokenService.GetPrivilegedAccessTokenAsync(); var httpclient = ApprenticeshipLevyApiClient.CreateHttpClient(tokenResult.AccessCode, _hmrcApiBaseUrlConfig.HmrcApiBaseUrl); return(new ApprenticeshipLevyApiClient(httpclient)); }
public async Task ThenItShouldReturnAccessToken() { // Act var actual = await _client.GetPrivilegedAccessTokenAsync(); // Assert Assert.IsNotNull(actual); Assert.AreEqual(AccessCode, actual.AccessCode); Assert.AreEqual(ExpiryTime, actual.ExpiryTime); }