Example #1
0
        public void GetAll_AllBasketDetailsCanListed()
        {
            IBasketDetailService basketDetailService = new BasketDetailManager(_mockBasketDetailDal.Object);
            List <BasketDetail>  basketDetails       = basketDetailService.GetAll().Data;

            Assert.AreEqual(2, basketDetails.Count);
        }
Example #2
0
        public void Update_UpdateBasketDetail_ReturnTrueResult()
        {
            IBasketDetailService basketDetailService = new BasketDetailManager(_mockBasketDetailDal.Object);
            BasketDetail         basketDetail        = new BasketDetail
            {
                Id         = 1,
                BasketId   = It.IsAny <int>(),
                ProductId  = It.IsAny <int>(),
                Count      = It.IsAny <int>(),
                CreateDate = DateTime.Now,
                Active     = true
            };
            var result = basketDetailService.Update(basketDetail);

            Assert.IsTrue(result.Success);
        }
Example #3
0
        // GET: Home
        public ActionResult Index()
        {
            CategoriesManager        cm    = new CategoriesManager();
            ProductsManager          pm    = new ProductsManager();
            BrandsManager            bm    = new BrandsManager();
            ColorManager             colm  = new ColorManager();
            SizeManager              sm    = new SizeManager();
            ProductCategoriesManager pcm   = new ProductCategoriesManager();
            ProductColorsManager     pcolm = new ProductColorsManager();
            ProductSizesManager      pszm  = new ProductSizesManager();

            BasketManager       basm = new BasketManager();
            BasketDetailManager bdm  = new BasketDetailManager();
            BasketTempManager   btm  = new BasketTempManager();
            ParamManager        parm = new ParamManager();

            Session["Categories"]           = cm.GetAll();
            Session["Products"]             = pm.GetAll();
            Session["Brands"]               = bm.GetAll();
            Session["Colors"]               = colm.GetAll();
            Session["Sizes"]                = sm.GetAll();
            Session["ProductCategories"]    = pcm.GetAll();
            Session["ProductColorsManager"] = pcolm.GetAll();
            Session["ProductSizesManager"]  = pszm.GetAll();

            Session["Basket"]       = basm.GetAll();
            Session["BasketDetail"] = bdm.GetAll();
            Session["BasketTemp"]   = btm.GetAll();
            Session["Param"]        = parm.GetAll();

            baskettlist = btm.GetAll();;

            ViewBag.Login  = "******";
            ViewBag.Logout = "Logout";
            return(View());
        }