Ejemplo n.º 1
0
 public ProductManager(IContextContainer container)
     : base(container)
 {
     _productDAO = new ProductDAO(container);
     _categoryDAO = new CategoryDAO(container);
     _attributeDAO = new AttributeDAO(container);
 }
Ejemplo n.º 2
0
 public TaskService(IProjectDAO projectDAO, ICategoryDAO categoryDAO, ITaskDAO taskDAO, IUserDAO userDAO)
 {
     this.projectDAO  = projectDAO;
     this.categoryDAO = categoryDAO;
     this.taskDAO     = taskDAO;
     this.userDAO     = userDAO;
 }
Ejemplo n.º 3
0
 public ProductManager(IContextContainer container)
     : base(container)
 {
     _productDAO   = new ProductDAO(container);
     _categoryDAO  = new CategoryDAO(container);
     _attributeDAO = new AttributeDAO(container);
 }
 public SubscriptionUtils(IUserDAO userDao, ITaskDAO taskDao, ISubscriptionDAO subscriptionDao,
                          IProjectStaffDAO projectStaffDao, IProjectDAO projectDao, IMapper mapper, ICompanyDAO companyDao,
                          ICategoryDAO categoryDao)
 {
     _userDao         = userDao;
     _taskDao         = taskDao;
     _subscriptionDao = subscriptionDao;
     _projectStaffDao = projectStaffDao;
     _projectDao      = projectDao;
     _mapper          = mapper;
     _companyDao      = companyDao;
     _categoryDao     = categoryDao;
 }
Ejemplo n.º 5
0
        public void Create_傳入已存在的分類名稱_拋出例外()
        {
            string categoryName = "BBB";

            ICategoryDAO dao = Substitute.For <ICategoryDAO>();

            dao.IsExist(Arg.Any <string>()).Returns(true);

            var service = new CategoryService(dao);
            var ex      = Assert.Throws <Exception>(() => service.Create(categoryName));

            Assert.That(() => ex.Message.Contains("存在"));
        }
Ejemplo n.º 6
0
        public void Create_傳入不存在的分類名稱_新增資料成功()
        {
            string categoryName = "BBB";

            ICategoryDAO dao = Substitute.For <ICategoryDAO>();

            dao.IsExist(Arg.Any <string>()).Returns(false);

            var service = new CategoryService(dao);

            service.Create(categoryName);

            dao.Received().Create(categoryName);
        }
Ejemplo n.º 7
0
        public void SetUp()
        {
            transaction = new TransactionScope();
            DALFactory factory = DALFactory.GetInstance();
            db = factory.CreateDatabase();
            dao = factory.CreateCategoryDAO(db);
            category = new Category {
                Id = 1,
                Description = "Musik",
                Color = "red"
            };

            runDbCommands(db, new List<string> {
                "SET FOREIGN_KEY_CHECKS=0",
                "DELETE FROM `category`",
                "INSERT INTO `category` VALUES (1, 'Musik', 'red')",
                "INSERT INTO `category` VALUES (2, 'Tanz', 'blue')"
            });
        }
Ejemplo n.º 8
0
 public CategoryService(ICategoryDAO dao, IMapper mapper) : base(dao, mapper)
 {
     _cateDAO = dao;
 }
Ejemplo n.º 9
0
 public CategoryManager(IContextContainer container)
     : base(container)
 {
     _categoryDAO = new CategoryDAO(container);
 }
Ejemplo n.º 10
0
 public CategoryBLL(ICategoryDAO iCategoryDAO)
 {
     _iCategoryDAO = iCategoryDAO;
 }
Ejemplo n.º 11
0
 public CategoryLogic(ICategoryDAO categoryDAO, ISQLDAO dao, ILoggerIO log)
 {
     logs         = log;
     categoryData = categoryDAO;      //injecting dependency
     categoryData.GetDataWriter(dao); //dependency injector through a infrastructure
 }
Ejemplo n.º 12
0
 public CategoryManager(IContextContainer container)
     : base(container)
 {
     _categoryDAO = new CategoryDAO(container);
 }
Ejemplo n.º 13
0
 public CategoriesController(ICategoryDAO categoryDAO)
 {
     this.categoryDAO = categoryDAO;
 }
Ejemplo n.º 14
0
 public CategoryController(ICategoryDAO categoryDAO)
 {
     this.cDao = categoryDAO;
 }