示例#1
0
        public void TestShowAllProducts()
        {
            Thread.Sleep(500);
            var productList = _productManagement.GetAllProducts();

            Assert.True(productList.Any());
        }
 public IActionResult Get()
 {
     try
     {
         return(Ok(_product.GetAllProducts()));
     }
     catch (Exception)
     {
         return(StatusCode(500));
     }
 }
        public IEnumerable <ProductInfo> ProductFilter(Filter filtersList)
        {
            var products = _productDb.GetAllProducts();

            var filteredProducts = FilterByPortability(filtersList.IsPortable, products);

            filteredProducts = FilterByWeight(filtersList.MinWeight, filtersList.MaxWeight, filteredProducts);

            filteredProducts = FilterByScreenSize(filtersList.MinScreenSize, filtersList.MaxScreenSize, filteredProducts);

            return(filteredProducts);
        }
        public void TestShowAllProducts()
        {
            var productList = _productManagement.GetAllProducts();

            Assert.True(productList.Any());
        }