예제 #1
0
        public void AddCategorySuccess()
        {
            AddCategorySlave slave = new AddCategorySlave(handler.Object, adminValidatorMocker.Object);

            slave.AddCategory("items");
            Assert.AreEqual((int)StoreEnum.Success, slave.Answer.Status);
        }
예제 #2
0
        public void AddCategoryWhenCategoryAlreadyExists()
        {
            AddCategorySlave slave = new AddCategorySlave(handler.Object, adminValidatorMocker.Object);

            handler.Setup(x => x.GetCategoryByName("items")).Returns(new Category("items"));
            slave.AddCategory("items");
            Assert.AreEqual((int)EditCategoryStatus.CategoryAlradyExist, slave.Answer.Status);
        }