public void Init()
 {
     ruleMapper = new PriceRulesMapper();
 }
 public void Cleanup()
 {
     ruleMapper = null;
 }
 public void Cleanup()
 {
     cartMapper = null;
     ruleMapper = null;
 }
 public void Init()
 {
     cartMapper = new ShoppingListMapper();
     ruleMapper = new PriceRulesMapper();
 }
Esempio n. 5
0
        public void CheckOut()
        {
            var slm = new ShoppingListMapper();
            var prm = new PriceRulesMapper();

            //process the price rules list
            var rules = prm.ReadRules(_priceRulesFile);

            //process the shopping cart
            var items = slm.ReadShoppingList(_cartFile);

            //check to make sure everything purchased has a price
            foreach ( var key in items.Keys)
            {
                if (rules.ContainsKey(key)) continue;

                var rule = prm.GetRuleForMissingItem(key);
                rules[key] = rule;
            }

            this.ProcessReceipt(items, rules, _compoundSavings);
        }