public void IdIsNullOrWhiteSpaceThrows(string id) { // given var subject = new MandateImportsClient(_clientConfiguration); // when AsyncTestDelegate test = () => subject.ForIdAsync(id); // then var ex = Assert.ThrowsAsync <ArgumentException>(test); Assert.That(ex.ParamName, Is.EqualTo(nameof(id))); }
public async Task CallsIndividualMandateImportEndpoint() { // given var subject = new MandateImportsClient(_clientConfiguration); var id = "IM12345678"; // when await subject.ForIdAsync(id); // then _httpTest .ShouldHaveCalled("https://api.gocardless.com/mandate_imports/IM12345678") .WithVerb(HttpMethod.Get); }
public async Task ReturnsIndividualMandateImport() { // given var subject = new MandateImportsClient(_clientConfiguration); var mandateImport = await _resourceFactory.CreateMandateImport(); // when var result = await subject.ForIdAsync(mandateImport.Id); // then Assert.That(result.Item, Is.Not.Null); Assert.That(result.Item.Id, Is.Not.Null.And.EqualTo(mandateImport.Id)); Assert.That(result.Item.CreatedAt, Is.Not.Null.And.EqualTo(mandateImport.CreatedAt)); Assert.That(result.Item.Scheme, Is.Not.Null.And.EqualTo(mandateImport.Scheme)); Assert.That(result.Item.Status, Is.Not.Null.And.EqualTo(mandateImport.Status)); }