public void TestScenario1() { List <CartModel> items = new List <CartModel>(); items.Add(new CartModel("A")); items.Add(new CartModel("B")); items.Add(new CartModel("C")); int result = _priceService.GetCheckoutPrice(items); Assert.AreEqual(result, 100); }
public static void Main(string[] args) { Console.WriteLine("Enter the Number of Items in the Cart"); int x = Convert.ToInt32(Console.ReadLine()); List <CartModel> items = new List <CartModel>(); for (int i = 0; i < x; i++) { Console.WriteLine("enter the items from the cart A or B or C or D"); string type = Console.ReadLine(); CartModel _items = new CartModel(type); items.Add(_items); } Program p = new Program(); int totalPrice = p.GetCheckoutPrice(items); Console.WriteLine(totalPrice); Console.ReadLine(); }