public void DeleteTest() { //Arrange db = new touch_for_foodEntities(); CategoryOM target = new CategoryOM(db); int expected = 1; int actual; //Check Setup Assert.IsNotNull(db.categories.Find(category2.id)); //Act actual = target.delete(category2.id); //Assert db = new touch_for_foodEntities(); Assert.AreEqual(expected, actual); Assert.IsNull(db.categories.Find(category2.id)); }
public void DeleteAssociationExistsExceptionItemTest() { //Arrange db = new touch_for_foodEntities(); CategoryOM target = new CategoryOM(db); int actual; //Act actual = target.delete(category3.id); //Assert Assert.IsNotNull(db.categories.Find(category3.id)); Assert.IsNotNull(db.items.Find(item1.id)); }
public CategoryController() { im = new CategoryIM(db); om = new CategoryOM(db); }