Esempio n. 1
0
        public void VerifyThatNewProductWasAddedToTheCart()
        {
            Shopping.ShoppingCart[] expectedNewCart = new Shopping.ShoppingCart[]
            {
                new Shopping.ShoppingCart {
                    product = "bananaaaaas", price = 10
                },
                new Shopping.ShoppingCart {
                    product = "apples", price = 3
                },
                new Shopping.ShoppingCart {
                    product = "grapes", price = 50
                },
                new Shopping.ShoppingCart {
                    product = "pears", price = 3
                },
                new Shopping.ShoppingCart {
                    product = "oranges", price = 11
                },
                new Shopping.ShoppingCart {
                    product = "lemons", price = 11
                },
                new Shopping.ShoppingCart {
                    product = "applepie", price = 50
                },
                new Shopping.ShoppingCart {
                    product = "cherries", price = 25
                },
                new Shopping.ShoppingCart {
                    product = "melon", price = 37
                }
            };

            Shopping.ShoppingCart[] newCart = Shopping.AddNewEntry(cart, "melon", 37);

            CollectionAssert.AreEqual(expectedNewCart, newCart);
        }