private Task ExecutePaymentTest(string testName, CountryCode country, string billingZip, Address customerBillingAddress, ref int testCounter) { testCounter++; var customer = new Customer { FirstName = country.ToString(), LastName = testCounter.ToString(), ShippingSameAsBilling = true, BillingAddress = customerBillingAddress }; var card = new CreditCard { CreditCardNumber = "4111111111111111", Issuer = Issuer.Visa, ExpirationDate = "12/2020", BillingZipCode = billingZip, }; var payment = new Payment { Amount = 0.10m }; return(Task.Factory.StartNew(() => { customer = Cst.CreateCustomerAsync(customer).Result; card.CustomerId = customer.Id; card = Acc.CreateCreditCardAccountAsync(card).Result; payment.AccountId = card.Id; payment = Pmnt.CreatePaymentAsync(payment).Result; if (payment.Id < 1) { Console.WriteLine($"Failed to create payment for test: {testName}"); throw new InternationPaymentsTestException("Failed to create payment"); } Harness.DumpObject(testName, payment); })); }