//Filtri e premere CERCA
        public async Task InsertProduct()
        {
            // Arrange
            UserBL userBL = new UserBL();

            userBL.SetGoogleCedential();
            Models.Product wProdotto = new Models.Product();
            wProdotto.Category    = "Uomo";
            wProdotto.Brand       = "armani";
            wProdotto.ProductName = "Pantalone";
            wProdotto.Color       = "Bianco";
            wProdotto.Description = "pantalone bello";
            wProdotto.Headmoney   = "L";
            wProdotto.Price       = 60.00;
            wProdotto.Quantity    = 30;
            wProdotto.Model       = "Pantalone";
            wProdotto.Image       = @"C:\Users\feder\Desktop\Ingegneria del Software\pantalone bianco.png";
            ProductBL wDB = new ProductBL();

            await wDB.InsertProduct(ProductEntityToProductModel.ConvertoProdyctEntityTOProductModel(wProdotto), "");

            Models.SearchProduct wFilter = new Models.SearchProduct();
            wFilter.ProductName = "pantalone";

            List <Product> wListProduct = ProductEntityToProductModel.ConvertoListProdyctEntityTOListProductModel(await wDB.GetListProducts(ProductEntityToProductModel.ConvertoProdyctEntityTOSearchProductModel(wFilter)));


            Assert.IsTrue(wListProduct.Count > 0);
        }
        //Non impostare filtri e premere CERCA
        public async Task Search()
        {
            // Arrange
            ProductController controller = new ProductController();
            UserBL            userBL     = new UserBL();

            userBL.SetGoogleCedential();
            ProductBL wDB = new ProductBL();

            List <Product> wListProduct = ProductEntityToProductModel.ConvertoListProdyctEntityTOListProductModel(await wDB.GetListProducts(ProductEntityToProductModel.ConvertoProdyctEntityTOSearchProductModel(new SearchProduct())));

            Assert.IsTrue(wListProduct.Count > 0);
        }
        //Filtro per Nome Prdotto e premere CERCA
        public async Task Search_7()
        {
            // Arrange
            UserBL userBL = new UserBL();

            userBL.SetGoogleCedential();
            Models.SearchProduct wFilter = new Models.SearchProduct();
            wFilter.ProductName = "polo";
            ProductBL wDB = new ProductBL();

            List <Product> wListProduct = ProductEntityToProductModel.ConvertoListProdyctEntityTOListProductModel(await wDB.GetListProducts(ProductEntityToProductModel.ConvertoProdyctEntityTOSearchProductModel(wFilter)));

            Assert.IsTrue(wListProduct.Count > 0);
        }
        //Filtri e premere CERCA
        public async Task Search_8()
        {
            // Arrange
            UserBL userBL = new UserBL();

            userBL.SetGoogleCedential();
            Models.SearchProduct wFilter = new Models.SearchProduct();
            wFilter.Category    = "Donna";
            wFilter.Brand       = "armani";
            wFilter.ProductName = "gonna";
            ProductBL wDB = new ProductBL();

            List <Product> wListProduct = ProductEntityToProductModel.ConvertoListProdyctEntityTOListProductModel(await wDB.GetListProducts(ProductEntityToProductModel.ConvertoProdyctEntityTOSearchProductModel(wFilter)));

            Assert.IsFalse(wListProduct.Count > 0);
        }
        public async Task <ActionResult> Search(SearchProduct collection)
        {
            try
            {
                // TODO: Add insert logic here
                ProductBL wDB = new ProductBL();

                List <Product> wListProduct = ProductEntityToProductModel.ConvertoListProdyctEntityTOListProductModel(await wDB.GetListProducts(ProductEntityToProductModel.ConvertoProdyctEntityTOSearchProductModel(collection)));
                TempData["ListProducts"] = wListProduct;

                return(RedirectToAction("Index", "Home", collection));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }