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); }
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); }