Beispiel #1
0
        public void AddingPricingRule_GetsCorrectPrice(string[] items, string itemName, int itemPrice, int expectedPrice)
        {
            Checkout c = new Checkout();

            c.ApplyPricingRules(new Dictionary <string, int>
            {
                { itemName, itemPrice }
            }
                                );

            foreach (string item in items)
            {
                c.Scan(item);
            }
            Assert.AreEqual(expectedPrice, c.Total);
        }