public void DeleteAssociationExistsExceptionTest() { //arrange db = new touch_for_foodEntities(); ItemOM target = new ItemOM(db); int actual; //act actual = target.delete(item2.id); //Assert db = new touch_for_foodEntities(); Assert.IsNotNull(db.items.Find(item2.id)); Assert.IsNotNull(db.menu_item.Find(menuItem1.id)); }
public ItemController() { im = new ItemIM(db); om = new ItemOM(db); }
public void DeleteTest() { //Arrange db = new touch_for_foodEntities(); ItemOM target = new ItemOM(db); int expected = 1; int actual; //Check setup Assert.IsNotNull(db.items.Find(item1.id)); //Act actual = target.delete(item1.id); //Assert db = new touch_for_foodEntities(); Assert.AreEqual(expected, actual); Assert.IsNull(db.items.Find(item1.id)); }