public async Task WhenGettingAccountFromBizfiBank()
        {
            var provider = new BizfiBankAccountProvider(new BizfiBankClient(new OptionsWrapper <BizfiBankConfiguration>(new BizfiBankConfiguration
            {
                BaseUrl = "https://bizfibank-bizfitech.azurewebsites.net/api/v1/"
            })), new MapperConfiguration(x => x.AddProfile <BizfiBankAccountToAccountProfile>()).CreateMapper());

            _result = await provider.TryGetAccount("12345678", CancellationToken.None);
        }
示例#2
0
        public async Task WhenGettingAccount()
        {
            var accountNumber = "12345678";

            var stubHttpMessageHandler = new StubHttpMessageHandlerBuilder().WithResponse(new Uri($"https://test.local/accounts/{accountNumber}"), _response, HttpStatusCode.NotFound)
                                         .Build();
            var httpClient = new HttpClient(stubHttpMessageHandler)
            {
                BaseAddress = new Uri("https://test.local")
            };
            var mapper = Substitute.For <IMapper>();

            _bizfiBankAccountProvider = new BizfiBankAccountProvider(httpClient, mapper);
            _result = await _bizfiBankAccountProvider.TryGetAccount(accountNumber, new CancellationToken());
        }
示例#3
0
        public async Task WhenGettingAccount()
        {
            var accountNumber = "12345678";

            _expected = new Account();

            var stubHttpMessageHandler = new StubHttpMessageHandlerBuilder().WithResponse(new Uri($"https://test.local/accounts/{accountNumber}"), _response)
                                         .Build();
            var httpClient = new HttpClient(stubHttpMessageHandler)
            {
                BaseAddress = new Uri("https://test.local")
            };
            var mapper = Substitute.For <IMapper>();

            mapper.Map <Account>(Arg.Any <FairWayTest.Api.Infrastructure.AccountProviders.Bizfibank.Responses.Account>()).Returns(_expected);

            _bizfiBankAccountProvider = new BizfiBankAccountProvider(httpClient, mapper);
            _result = await _bizfiBankAccountProvider.TryGetAccount(accountNumber, new CancellationToken());
        }