예제 #1
0
        public static OrderBase CreateOrder3()
        {
            OrderBase order = new MockOrder();

            //MockProduct prodA = new MockProduct("Product1", 50, "A");
            // add items to the cart
            // 3 A MockProduct
            order.AddProduct(new MockProduct("Product1", 50, "A"));
            order.AddProduct(new MockProduct("Product1", 50, "A"));
            order.AddProduct(new MockProduct("Product1", 50, "A"));

            // 5 B MockProduct
            order.AddProduct(new MockProduct("Product2", 30, "B"));
            order.AddProduct(new MockProduct("Product2", 30, "B"));
            order.AddProduct(new MockProduct("Product2", 30, "B"));
            order.AddProduct(new MockProduct("Product2", 30, "B"));
            order.AddProduct(new MockProduct("Product2", 30, "B"));

            // 1 C & 1 D
            order.AddProduct(new MockProduct("Product3", 20, "C"));
            order.AddProduct(new MockProduct("Product4", 15, "D"));

            //order.AddProduct(new MockProduct("Product1", 50, "A"));
            //order.AddProduct(new MockProduct("Product1", 50, "A"));


            applyAllDiscounts(order);

            return(order);
        }
예제 #2
0
        public static OrderBase CreateOrder1()
        {
            OrderBase order = new MockOrder();
            //MockProduct prodA = new MockProduct("Product1", 50, "A");
            // add items to the cart
            MockProduct prodA = new MockProduct("Product1", 50, "A");
            MockProduct prodB = new MockProduct("Product2", 30, "B");
            MockProduct prodC = new MockProduct("Product3", 20, "C");

            // MockProduct prodD = new MockProduct("Product4", 15, "D");

            order.AddProduct(prodA);
            order.AddProduct(prodB);
            order.AddProduct(prodC);
            //order.AddProduct(new MockProduct("Product1", 50, "A"));
            //order.AddProduct(new MockProduct("Product1", 50, "A"));

            applyAllDiscounts(order);


            return(order);
        }