Ejemplo n.º 1
0
        public void ShoppingCart_AddPastryToList_Pastry()
        {
            Pastry muffin = new Pastry("Muffin");

            ShoppingCart.AddPastry(muffin);
            List <Pastry> pastryCart = ShoppingCart.GetPastry();

            Assert.AreEqual(muffin.Description, pastryCart[0].Description);
        }
Ejemplo n.º 2
0
        public void ShoppingCart_GetGrandTotal_int()
        {
            Bread sourDough = new Bread("Sour Dough");

            ShoppingCart.AddBread(sourDough);
            ShoppingCart.AddBread(sourDough);
            ShoppingCart.AddBread(sourDough);
            ShoppingCart.AddBread(sourDough);
            ShoppingCart.AddBread(sourDough);
            List <Bread> breadCart = ShoppingCart.GetBread();
            Pastry       muffin    = new Pastry("Muffin");

            ShoppingCart.AddPastry(muffin);
            ShoppingCart.AddPastry(muffin);
            ShoppingCart.AddPastry(muffin);
            ShoppingCart.AddPastry(muffin);
            ShoppingCart.AddPastry(muffin);
            List <Pastry> pastryCart = ShoppingCart.GetPastry();
            int           total      = ShoppingCart.GetTotal();

            Assert.AreEqual(29, total);
        }