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))); }
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); }
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); }