public void UserShouldBeAbleToAddPaymentTypeForCustomer() { PaymentType newPaymentType = new PaymentType() { Id = 1, Name = "Visa", AccountNumber = 7287492, CustomerId = 13 }; List <PaymentType> emptyList = _customerManager.GetActiveCustomerPaymentTypes(); Assert.True(emptyList.Count == 0); List <PaymentType> allPaymentTypes = _customerManager.AddNewPaymentType(newPaymentType); Assert.Contains(newPaymentType, allPaymentTypes); }
public static void DoAction(CustomerManager customerManager) { Console.Clear(); Console.WriteLine("Enter Payment Type Name (ex. Visa)"); Console.Write("> "); string paymentTypeName = Console.ReadLine(); Console.WriteLine("Enter Account Number"); Console.Write("> "); int paymentTypeAccountNumber = int.Parse(Console.ReadLine()); PaymentType newPaymentType = new PaymentType() { Name = paymentTypeName, AccountNumber = paymentTypeAccountNumber, CustomerId = CustomerManager.activeCustomer.Id }; customerManager.AddNewPaymentType(newPaymentType); }