public void Get_Account_By_Id_Should_Return_All_Transactions() { _handlerClient = new HttpClientHandlerService(_appSettings.Object, _sessionService.Object); _authService.Setup(a => a.GetAuthorizationUri()).Returns(new System.Uri(callback_with_auth_code)); //act AccountsServices ac = new AccountsServices(_appSettings.Object, _sessionService.Object, _authService.Object, _handlerClient); var response = ac.GetAccount(test_accountId); //assert Assert.NotNull(response); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); }
public void Get_Account_By_Id_Should_Transactions() { // arrange HttpContent resContent = new StringContent(response_content_account); _handlerClientMock.Setup(a => a.GetDataFromTrueLayer(It.IsAny <string>(), It.IsAny <string>(), null)).ReturnsAsync(new HttpResponseMessage { StatusCode = System.Net.HttpStatusCode.OK, Content = resContent }); _handlerClient = new HttpClientHandlerService(_appSettings.Object, _sessionService.Object); //act AccountsServices ac = new AccountsServices(_appSettings.Object, _sessionService.Object, _authService.Object, _handlerClientMock.Object); var response = ac.GetAccount(test_accountId); //assert Assert.NotNull(response); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); }
public AccountsServices(IOptions <HandlerSettings> appSettings, ISessionService sessionService, IAuthService authService, IHandlerHttpClient handlerClient) { _appSettings = appSettings; _authService = authService; _httpClient = handlerClient; }
public AuthService(IOptions <HandlerSettings> appSettings, ISessionService sessionService, IHandlerHttpClient handlerClient) { _appSettings = appSettings; _sessionService = sessionService; _httpClient = handlerClient; }