Ejemplo n.º 1
0
        public void Create_return_ok()
        {
            IUnitOfWork        unitOfWork            = new UnitOfWorkMock();
            IFoodsCategories   foodCategoriesManager = new FoodsCategories(unitOfWork);
            EditedFoodCategory category = new EditedFoodCategory()
            {
                Name = "New category"
            };
            var response = foodCategoriesManager.Create(category);

            Assert.IsTrue(response.IsValid);
        }
Ejemplo n.º 2
0
        public void Create_return_bad()
        {
            IUnitOfWork        unitOfWork     = new UnitOfWorkMock();
            IFoodsCategories   foodCategories = new FoodsCategories(unitOfWork);
            EditedFoodCategory category       = new EditedFoodCategory()
            {
                Name = "Registered category"
            };
            var response = foodCategories.Create(category);

            Assert.AreEqual(response.StatusCode, 400);
            Assert.IsFalse(response.IsValid);
        }