public void BillCalculator_CalculateBill_Ok()
        {
            var billCalculator = new BillCalculator();
            var menuItems      = new string[] { "Cola", "Coffee", "Cheese Sandwich" };

            var billAmount = billCalculator.CalculateBill(menuItems);

            Assert.AreEqual(3.85D, billAmount);

            menuItems  = new string[] { "Cola", "Steak Sandwich" };
            billAmount = billCalculator.CalculateBill(menuItems);

            Assert.AreEqual(6.0D, billAmount);
        }
Beispiel #2
0
        public void TestToCheckWhetherApplicationProvidesValidOutputForAGivenValidInput()
        {
            var inputProducts = new List <string>()
            {
                "1", "4", "7"
            };

            var categoryToProductsMapping = productsProvider.GetCategoryAndProductsMapping();

            var grandTotal = BillCalculator.CalculateBill(inputProducts, categoryToProductsMapping);

            Assert.AreEqual(grandTotal, 116.7);
        }