public async Task ReturnsIndividualCustomerBankAccount() { // given var customer = await _resourceFactory.CreateLocalCustomer(); var customerBankAccount = await _resourceFactory.CreateCustomerBankAccountFor(customer); var subject = new CustomerBankAccountsClient(_clientConfiguration); // when var result = await subject.ForIdAsync(customerBankAccount.Id); var actual = result.Item; // then Assert.That(actual, Is.Not.Null); Assert.That(actual.Id, Is.Not.Null.And.EqualTo(customerBankAccount.Id)); Assert.That(actual.AccountHolderName, Is.Not.Null.And.EqualTo(customerBankAccount.AccountHolderName)); Assert.That(actual.AccountNumberEnding, Is.Not.Null.And.EqualTo(customerBankAccount.AccountNumberEnding)); Assert.That(actual.BankName, Is.Not.Null.And.EqualTo(customerBankAccount.BankName)); Assert.That(actual.CountryCode, Is.Not.Null.And.EqualTo(customerBankAccount.CountryCode)); Assert.That(actual.Currency, Is.Not.Null.And.EqualTo(customerBankAccount.Currency)); Assert.That(actual.Links.Customer, Is.Not.Null.And.EqualTo(customerBankAccount.Links.Customer)); Assert.That(actual.Metadata, Is.Not.Null.And.EqualTo(customerBankAccount.Metadata)); Assert.That(actual.Enabled, Is.EqualTo(customerBankAccount.Enabled)); }
public async Task CallsIndividualCustomerBankAccountsEndpoint() { // given var subject = new CustomerBankAccountsClient(_clientConfiguration); var id = "BA12345678"; // when await subject.ForIdAsync(id); // then _httpTest .ShouldHaveCalled("https://api.gocardless.com/customer_bank_accounts/BA12345678") .WithVerb(HttpMethod.Get); }
public void IdIsNullOrWhiteSpaceThrows(string id) { // given var subject = new CustomerBankAccountsClient(_clientConfiguration); // when AsyncTestDelegate test = () => subject.ForIdAsync(id); // then var ex = Assert.ThrowsAsync <ArgumentException>(test); Assert.That(ex.Message, Is.Not.Null); Assert.That(ex.ParamName, Is.EqualTo(nameof(id))); }