public async Task verifyAccountCreditCardExpirationDate(int ownerId, DateTime expireDate) { ownerCollection = testDataManager.GetEnrolledOwnerCollection(ownerId); accounts = await billingRestClient.GetBillingAccountByPolicyHolderId(ownerCollection.OwnerInformation.UniqueId.ToString()); // get payment method List <PaymentMethod> methods = await billingRestClient.GetAccountPaymentMethods(ownerId); PaymentMethod method = methods.First(); if (method.Type == BillingPaymentMethodTypes.CreditCard.ToString()) { Assert.IsTrue(expireDate.Year == method.CreditCardExpirationYear && expireDate.Month == method.CreditCardExpirationMonth, $"creditcard expiration date doesn't match expencted {expireDate}"); } else { Assert.Inconclusive("payment method is not credit card"); } }
public async Task <PaymentMethod> verifyAccountDefaultPaymentMethod(int ownerId, BillingPaymentMethodTypes method) { List <PaymentMethod> methods = new List <PaymentMethod>(); PaymentMethod curMethod = new PaymentMethod(); try { ownerCollection = testDataManager.GetEnrolledOwnerCollection(ownerId); accounts = await billingRestClient.GetBillingAccountByPolicyHolderId(ownerCollection.OwnerInformation.UniqueId.ToString()); methods = await billingRestClient.GetAccountPaymentMethods(ownerId); curMethod = methods.Where(m => m.Id == accounts.First().DefaultPaymentMethodId).First(); } catch (Exception ex) { Logger.Log.Fatal(ex); } Assert.IsTrue(curMethod.Type.Equals(method.ToString()), $"default payment method {curMethod.Type} doesn't match expencted {method.ToString()}"); return(curMethod); }