Beispiel #1
0
        // We want to unit test this method without calling the DB
        public double Evaluate()
        {
            double sum = 0;

            foreach (Item item in _cart.Keys)
            {
                // This will look up the price in our DB. We don't want our unit tests to call the DB!
                sum += _prices.CheckPrice(item) * _cart[item];
            }

            return(sum);
        }