public void Delete_DeletesTheAddress()
{
Customer customer = gateway.Customer.Create(new CustomerRequest()).Target;
var addressRequest = new AddressRequest
{
StreetAddress = "1 E Main St",
ExtendedAddress = "Apt 3",
};
Address createdAddress = gateway.Address.Create(customer.Id, addressRequest).Target;
Assert.AreEqual(createdAddress.Id, gateway.Address.Find(customer.Id, createdAddress.Id).Id);
try {
Result<Address> result = gateway.Address.Delete(customer.Id, createdAddress.Id);
Assert.IsTrue(result.IsSuccess());
} catch (NotFoundException) {
Assert.Fail("Unable to delete the created address");
}
Assert.Throws<NotFoundException> (() => gateway.Address.Find(customer.Id, createdAddress.Id));
}