public void CancelIdIsNullOrWhiteSpaceThrows(string id)
        {
            // given
            var subject = new MandateImportsClient(_clientConfiguration);

            // when
            AsyncTestDelegate test = () => subject.CancelAsync(id);

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

            Assert.That(ex.ParamName, Is.EqualTo(nameof(id)));
        }
        public async Task CallsCancelMandateImportEndpoint()
        {
            // given
            var subject = new MandateImportsClient(_clientConfiguration);
            var id      = "IM12345678";

            // when
            await subject.CancelAsync(id);

            // then
            _httpTest
            .ShouldHaveCalled("https://api.gocardless.com/mandate_imports/IM12345678/actions/cancel")
            .WithVerb(HttpMethod.Post);
        }
        public async Task CancelsMandateImport()
        {
            // given
            var subject       = new MandateImportsClient(_clientConfiguration);
            var mandateImport = await _resourceFactory.CreateMandateImport();

            // when
            var result = await subject.CancelAsync(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.Not.EqualTo(mandateImport.Status));
        }