public void TestForProductAWith4Item()
        {
            var cart = new Cart
            {
                Products = new List <Product> {
                    new Product {
                        Id = 1, Name = "A", Price = 50
                    },
                    new Product {
                        Id = 1, Name = "A", Price = 50
                    },
                    new Product {
                        Id = 1, Name = "A", Price = 50
                    },
                    new Product {
                        Id = 1, Name = "A", Price = 50
                    },
                }
            };

            var checkout = new Checkout();
            var result   = checkout.CalculateCartPrice(cart);

            Assert.AreEqual(180, result);
        }
        public void TestForProductDItem()
        {
            var cart = new Cart
            {
                Products = new List <Product> {
                    new Product {
                        Id = 3, Name = "D", Price = 15
                    }
                }
            };

            var checkout = new Checkout();
            var result   = checkout.CalculateCartPrice(cart);

            Assert.AreEqual(15, result);
        }
        public void TestForProductABCDfinal2Item()
        {
            var cart = new Cart
            {
                Products = new List <Product> {
                    new Product {
                        Id = 1, Name = "A", Price = 50
                    },
                    new Product {
                        Id = 1, Name = "A", Price = 50
                    },
                    new Product {
                        Id = 1, Name = "A", Price = 50
                    },
                    new Product {
                        Id = 1, Name = "A", Price = 50
                    },
                    new Product {
                        Id = 2, Name = "B", Price = 30
                    },
                    new Product {
                        Id = 2, Name = "B", Price = 30
                    },
                    new Product {
                        Id = 2, Name = "B", Price = 30
                    },
                    new Product {
                        Id = 2, Name = "B", Price = 30
                    },
                    new Product {
                        Id = 2, Name = "B", Price = 30
                    },
                    new Product {
                        Id = 4, Name = "D", Price = 15
                    },
                    new Product {
                        Id = 3, Name = "C", Price = 20
                    },
                }
            };

            var checkout = new Checkout();
            var result   = checkout.CalculateCartPrice(cart);

            Assert.AreEqual(330, result);
        }