Пример #1
0
        public void ShouldCalculateTotalsPerItem()
        {
            var prices = new MockPrices().GetMockPrices();
            var calc   = new CartTotalCalculator(prices);

            var total = calc.GetTotalForItem(new KeyValuePair <string, int>("A99", 4));

            Assert.AreEqual(1.80M, total);
        }
Пример #2
0
        public void ShouldCalculateTotals()
        {
            var prices = new MockPrices().GetMockPrices();
            var calc   = new CartTotalCalculator(prices);

            var total = calc.GetTotal(new Dictionary <string, int>
            {
                ["A99"] = 4,
                ["C40"] = 1
            });

            Assert.AreEqual(3.60M, total);
        }