Exemple #1
0
        public void Buy7Jeansfor5()
        {
            ShoppingCart sc = new ShoppingCart();

            Product jean = new Jean(20);

            sc.Add(jean, 7);

            double totalPrice = sc.TotalValue();

            Assert.AreEqual(100, totalPrice);
        }
Exemple #2
0
        public string GetPants(int id, int weight, int stock, int inseam, int size)
        {
            Jean jean = new Jean
            {
                ID        = id,
                Weight    = weight,
                Stock     = stock,
                Inseam    = inseam,
                WaistSize = size
            };

            return(jean.GetFeatures());
        }
Exemple #3
0
        public void InitShoppingCart()
        {
            ShoppingCart sc = new ShoppingCart();

            Product productA = new tshirt(10);
            Product productB = new Jean(20);

            sc.Add(productA);
            sc.Add(productB);


            Assert.AreEqual(2, sc.Products.Count);
        }
Exemple #4
0
        public void Buy2Jeans2Tshirt()
        {
            ShoppingCart sc = new ShoppingCart();

            Product jean   = new Jean(20);
            Product tshirt = new tshirt(10);

            sc.Add(jean, 2);
            sc.Add(tshirt, 2);

            double totalPrice = sc.TotalValue();

            Assert.AreEqual(45, totalPrice);
        }
Exemple #5
0
        public void Sc1AddTshirtAndJean()
        {
            ShoppingCart sc = new ShoppingCart();

            Product tshirt = new tshirt(10);
            Product jean   = new Jean(20);

            sc.Add(tshirt);
            sc.Add(jean);

            double totalPrice = sc.TotalValue();

            Assert.AreEqual(30, totalPrice);
        }