public void Get_all_returns_all_categories()
        {
            EfCategoryDal categoryDal = new EfCategoryDal();
            var           result      = categoryDal.GetList();

            Assert.AreEqual(4, result.Count);
        }
Exemplo n.º 2
0
        public void Get_all_with_parameters_returns_filtered_category()
        {
            EfCategoryDal categoryDal = new EfCategoryDal();
            var           result      = categoryDal.GetList(c => c.Description.Contains("sea"));

            Assert.AreEqual(2, result.Count);
        }
        public void Get_all_with_returns_filtered_categories()
        {
            EfCategoryDal categoryDal = new EfCategoryDal();
            var           result      = categoryDal.GetList(x => x.CategoryName.Contains("salata"));

            Assert.AreEqual(1, result.Count);
        }
Exemplo n.º 4
0
        private static void CategoryDeleted()
        {
            EfCategoryDal efCategoryDal = new EfCategoryDal();

            efCategoryDal.Delete(new Category()
            {
                CategoryId = 1,
            });
        }
Exemplo n.º 5
0
        private static void CategoryAdded()
        {
            EfCategoryDal efCategoryDal = new EfCategoryDal();

            efCategoryDal.Add(new Category()
            {
                CategoryId   = 1,
                CategoryName = "A Segmenti"
            });
        }
 private ShoesDbContext _context;  // Dependecy Injection
 public UnitOfWork_Class(ShoesDbContext context)
 {
     _context = context;
     //
     CategoryDal    = new EfCategoryDal();
     BrandDal       = new EfBrandDal();
     CarouselDal    = new EfCarouselDal();
     ProductDal     = new EfProductDal();
     ProductSizeDal = new EfProductSizeDal();
     RoleDal        = new EfRoleDal();
     SizeDal        = new EfSizeDal();
     UserDal        = new EfUserDal();
 }
        private void AddBllBindings()
        {
            ninjectKernel.Bind <ICategoryService>()
            .To <CategoryManager>()
            .WithConstructorArgument("categoryDal", EfCategoryDal.CreateAsSingleton());

            ninjectKernel.Bind <IAnswerService>()
            .To <AnswerManager>()
            .WithConstructorArgument("efAnswerDal", EfAnswerDal.CreateAsSingleton());

            ninjectKernel.Bind <IQuestionService>()
            .To <QuestionManager>()
            .WithConstructorArgument("efQuestionDal", EfQuestionDal.CreateAsSingleton());
        }
Exemplo n.º 8
0
        private static void RegisterServices(IKernel kernel)
        {
            kernel.Bind <ICategoryService>()
            .To <CategoryManager>()
            .WithConstructorArgument("categoryDal", EfCategoryDal.CreateAsSingleton());

            kernel.Bind <IAnswerService>()
            .To <AnswerManager>()
            .WithConstructorArgument("efAnswerDal", EfAnswerDal.CreateAsSingleton());

            kernel.Bind <IQuestionService>()
            .To <QuestionManager>()
            .WithConstructorArgument("efQuestionDal", EfQuestionDal.CreateAsSingleton());
        }
Exemplo n.º 9
0
 public UnitOfWork(DataAccessLayer.DAL.DatabaseContext context)
 {
     _context = context;
     // ONEMLI!!
     BasketDal      = new EfBasketDal(_context);
     BuyDal         = new EfBuyDal(_context);
     CategoryDal    = new EfCategoryDal(_context);
     ColorsDal      = new EfColorsDal(_context);
     CustomerDal    = new EfCustomerDal(_context);
     FavsDal        = new EfFavsDal(_context);
     ImagesDal      = new EfImagesDal(_context);
     ProductDal     = new EfProductDal(_context);
     RolesDal       = new EfRolesDal(_context);
     SizeDal        = new EfSizeDal(_context);
     SubCategoryDal = new EfSubCategoryDal(_context);
     BrandDal       = new EfBrandDal(_context);
 }
Exemplo n.º 10
0
 public UnitofWork(DatabaseContext context)
 {
     _context       = context;
     CategoryDal    = new EfCategoryDal(_context);
     BasketDal      = new EfBasketDal(_context);
     BillAdressDal  = new EfBillAdressDal(_context);
     BrandDal       = new EfBrandDal(_context);
     ColorsDal      = new EfColorsDal(_context);
     CommentsDal    = new EfCommentsDal(_context);
     CredicartDal   = new EfCredicartDal(_context);
     CustomerDal    = new EfCustomerDal(_context);
     DiscountDal    = new EfDiscountDal(_context);
     FavDal         = new EfFavDal(_context);
     HomeSliderDal  = new EfHomeSliderDal(_context);
     ImageFilesDal  = new EfImageFilesDal(_context);
     ProductDal     = new EfProductDal(_context);
     SalesDal       = new EfSalesDal(_context);
     SizeDal        = new EfSizeDal(_context);
     SubCategoryDal = new EfSubCategoryDal(_context);
 }
Exemplo n.º 11
0
 public CategoryManager(EfCategoryDal efCategoryDal)
 {
 }
Exemplo n.º 12
0
 public CategoryManager(EfCategoryDal efCategoryDal)
 {
     this.efCategoryDal = efCategoryDal;
 }
Exemplo n.º 13
0
 public CategoryManager(EfCategoryDal categoryDal)
 {
     _categoryDal = categoryDal;
 }