Пример #1
0
        public void SearchAndRetrieveItemFromShelfTest()
        {
            var objShelf = new StoreShelf();
            var product  = objShelf.SearchAndRetrieveItemFromShelf("book", 12.49M, false, 1);

            Assert.IsNotNull(product);
        }
Пример #2
0
        public void AddItemToCartTest()
        {
            var storeShelf   = new StoreShelf();
            var shoppingCart = new ShoppingCart();

            shoppingCart.AddItemToCart(storeShelf.SearchAndRetrieveItemFromShelf("book", 12.49M, false, 1));
            Assert.IsNotNull(shoppingCart.GetItemsFromCart());
        }
Пример #3
0
        public void TestCase1_CalculateSalesTax()
        {
            Product p1 = storeShelf.SearchAndRetrieveItemFromShelf("book", 12.49, false, 1);
            Product p2 = storeShelf.SearchAndRetrieveItemFromShelf("music cd", 14.99, false, 1);
            Product p3 = storeShelf.SearchAndRetrieveItemFromShelf("box of chocolates", 0.85, false, 1);

            shoppingCartObj.AddItemToCart(p1);
            shoppingCartObj.AddItemToCart(p2);
            shoppingCartObj.AddItemToCart(p3);

            List <Product> productList = shoppingCartObj.GetItemsFromCart();

            biller.CalcSalesTax(productList);
            double totalTax    = biller.CalcTotalTax(productList);
            double totalAmount = biller.CalcTotalAmount(productList);

            Assert.AreEqual(1.50d, totalTax);
            Assert.AreEqual(29.83d, totalAmount);
        }