コード例 #1
0
        public void BankDetailsLookupRequestIsNullThrows()
        {
            // given
            var subject = new BankDetailsLookupsClient(_clientConfiguration);

            BankDetailsLookupRequest request = null;

            // when
            AsyncTestDelegate test = () => subject.LookupAsync(request);

            // then
            var ex = Assert.ThrowsAsync <ArgumentNullException>(test);

            Assert.That(ex.ParamName, Is.EqualTo(nameof(request)));
        }
コード例 #2
0
        public async Task BankDetailsLookupEndpoint()
        {
            // given
            var subject = new BankDetailsLookupsClient(_clientConfiguration);

            var request = new BankDetailsLookupRequest();

            // when
            await subject.LookupAsync(request);

            // then
            _httpTest
            .ShouldHaveCalled("https://api.gocardless.com/bank_details_lookups")
            .WithVerb(HttpMethod.Post);
        }
コード例 #3
0
        public async Task LooksupBankDetails()
        {
            // given
            var subject = new BankDetailsLookupsClient(_clientConfiguration);

            var request = new BankDetailsLookupRequest
            {
                AccountNumber = "55779911",
                BranchCode    = "200000",
                CountryCode   = "GB",
            };

            // when
            var result = await subject.LookupAsync(request);

            // then
            Assert.That(result.Item, Is.Not.Null);
            Assert.That(result.Item.AvailableDebitSchemes, Is.Not.Null.And.Not.Empty);
            Assert.That(result.Item.BankName, Is.Not.Null);
            Assert.That(result.Item.Bic, Is.Not.Null);
        }