public void Story_Delete() { var story = StoryTestHelper.StoryNew(); Assert.IsTrue(story.IsValid, "IsValid should be true"); story = StoryRepository.StorySave(story); story = StoryRepository.StoryFetch(story.StoryId); StoryRepository.StoryDelete(story.StoryId); try { StoryRepository.StoryFetch(story.StoryId); } catch (Exception ex) { Assert.IsTrue(ex.GetBaseException() is InvalidOperationException); } }
public ActionResult Delete(int id, FormCollection collection) { StoryRepository.StoryDelete(id); return(this.RedirectToAction("Index", "Home")); }