Beispiel #1
0
        public RunningTotal Apply(RunningTotal runningTotal)
        {
            while (runningTotal.Count(Butter) >= 2 && runningTotal.Count(Bread) >= 1)
            {
                runningTotal = runningTotal.ApplyPrice(_rulePrice, _qualifyingItems);
            }

            return(runningTotal);
        }
Beispiel #2
0
        public RunningTotal Apply(RunningTotal runningTotal)
        {
            while (runningTotal.Count(Milk) >= 4)
            {
                runningTotal = runningTotal.ApplyPrice(_rulePrice, _qualifyingItems);
            }

            return(runningTotal);
        }