public void IdIsNullOrWhiteSpaceThrows(string id) { // given var subject = new CreditorBankAccountsClient(_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))); }
public async Task CallsIndividualCreditorBankAccountsEndpoint() { // given var subject = new CreditorBankAccountsClient(_clientConfiguration); var id = "BA12345678"; // when await subject.ForIdAsync(id); // then _httpTest .ShouldHaveCalled("https://api.gocardless.com/creditor_bank_accounts/BA12345678") .WithVerb(HttpMethod.Get); }
public async Task ReturnsIndividualCreditorBankAccount() { // given var subject = new CreditorBankAccountsClient(_clientConfiguration); var creditorBankAccount = (await subject.GetPageAsync()).Items.First(); // when var result = await subject.ForIdAsync(creditorBankAccount.Id); var actual = result.Item; // then Assert.That(actual, Is.Not.Null); Assert.That(actual.Id, Is.Not.Null.And.EqualTo(creditorBankAccount.Id)); Assert.That(actual.AccountHolderName, Is.Not.Null.And.EqualTo(creditorBankAccount.AccountHolderName)); Assert.That(actual.AccountNumberEnding, Is.Not.Null.And.EqualTo(creditorBankAccount.AccountNumberEnding)); Assert.That(actual.BankName, Is.Not.Null.And.EqualTo(creditorBankAccount.BankName)); Assert.That(actual.CountryCode, Is.Not.Null.And.EqualTo(creditorBankAccount.CountryCode)); Assert.That(actual.Currency, Is.Not.Null.And.EqualTo(creditorBankAccount.Currency)); Assert.That(actual.Links.Creditor, Is.Not.Null.And.EqualTo(creditorBankAccount.Links.Creditor)); Assert.That(actual.Enabled, Is.EqualTo(creditorBankAccount.Enabled)); }