public void ShouldReturnTop5Products()
        {
            //arrange
            //act
            var result = _channelEngineProductService.GetProductsFromOrders().Result;

            //assert
            Assert.Equal(5, result.Count);
        }
        public async Task Execute()
        {
            var products = await _channelEngineProductService.GetProductsFromOrders();

            await UpdateProduct(products);

            _consoleService.Display($"EAN  MerchantProductNo  Quantity");
            foreach (var product in products)
            {
                _consoleService.Display($"{product.EAN} {product.MerchantProductNo} {product.Quantity}");
            }
            _consoleService.ReadKey();
        }
예제 #3
0
        public async Task <IActionResult> Index()
        {
            var products = await _channelEngineProductService.GetProductsFromOrders();

            var productToUpdate = products.FirstOrDefault();

            if (productToUpdate != null)
            {
                await _channelEngineProductService.UpdateProductStock(productToUpdate.MerchantProductNo, 25);
            }

            var productsViewModel = products.Select(p => p.MapToProductViewModel()).ToList();

            return(View(productsViewModel));
        }