Example #1
0
        public void VerifyThatTheMostExpensiveProductsAreEliminatedFromTheCart()
        {
            Shopping.ShoppingCart[] expectedCart = new Shopping.ShoppingCart[]
            {
                new Shopping.ShoppingCart {
                    product = "bananaaaaas", price = 10
                },
                new Shopping.ShoppingCart {
                    product = "apples", price = 3
                },
                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 = "cherries", price = 25
                },
            };

            Shopping.ShoppingCart[] newCart = Shopping.EliminateTheMostExpensiveProduct(cart);

            Assert.AreEqual(expectedCart.Length, newCart.Length);
            CollectionAssert.AreEqual(expectedCart, newCart);
        }