Beispiel #1
0
        public Checkout(ICheckoutFactory checkoutFactory, ISuperMarketData superMarketRepo)
        {
            _scannedItems    = new List <string>();
            _checkoutFactory = checkoutFactory;
            _superMarketRepo = superMarketRepo;

            //_itemPriceRules = itemPriceRules; //_checkoutFactory.CreateCheckout();
        }
        public void Setup()
        {
            IEnumerable <ProductDto> products = new List <ProductDto>
            {
                new ProductDto {
                    Sku = "A99", UnitPrice = 0.50m
                },
                new ProductDto {
                    Sku = "B15", UnitPrice = 0.30m
                },
                new ProductDto {
                    Sku = "C40", UnitPrice = 1.80m
                },
                new ProductDto {
                    Sku = "T23", UnitPrice = 0.99m
                },
            };

            _repo = new SuperMarketData();
        }
Beispiel #3
0
 public ItemPriceRuleFactory(ISuperMarketData superMarketRepo)
 {
     _superMarketRepo  = superMarketRepo;
     _itemCodePriceMap = _superMarketRepo.DisplayAvailableItems().ToDictionary(x => x.Sku, x => x.UnitPrice);
 }
 public CheckoutFactory(IItemPriceRuleFactory itemPriceRuleFactory, ISuperMarketData superMarketRepo)
 {
     _itemPriceRuleFactory = itemPriceRuleFactory;
     _superMarketRepo      = superMarketRepo;
 }