Example #1
0
        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);
            }
        }
Example #2
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            StoryRepository.StoryDelete(id);

            return(this.RedirectToAction("Index", "Home"));
        }