Beispiel #1
0
        public void PriceOfItemIsReturnedForExistingItem()
        {
            var itemCatalog = new ItemCatalog()
            {
                { new ItemCode("A"), new Money(50) },
                { new ItemCode("B"), new Money(30) }
            };

            itemCatalog.PriceOf(new ItemCode("A")).Should().Be(new Money(50));
        }
        public Money Total()
        {
            var total = new Money(0);

            foreach (var item in _scannedItems)
            {
                total.Add(_itemCatalog.PriceOf(item));
            }

            total.Subtract(TotalDiscountGiven());

            return(total);
        }