Exemplo n.º 1
0
        public List <Product> GetAvailableItems()
        {
            var availableItems = _superMarketRepo.DisplayAvailableItems();

            return(availableItems.Select(x => new Product {
                Sku = x.Sku, Description = x.Description, UnitPrice = x.UnitPrice
            }).ToList());
        }
Exemplo n.º 2
0
        public void ItGetsAllAvailableItems()
        {
            //Arrange

            //Act
            var availableItems = _repo.DisplayAvailableItems();

            //Assert
            Assert.IsNotNull(availableItems);
        }
Exemplo n.º 3
0
 public ItemPriceRuleFactory(ISuperMarketData superMarketRepo)
 {
     _superMarketRepo  = superMarketRepo;
     _itemCodePriceMap = _superMarketRepo.DisplayAvailableItems().ToDictionary(x => x.Sku, x => x.UnitPrice);
 }