Example #1
0
        public void Get_Edit_View_Should_Return_Edit_View()
        {
            var homeController = new HomeController();
            homeController.Create(new BlogEntry("UniqueTitle"));
            var result = homeController.Edit("UniqueTitle") as ViewResult;
            var blogEntry = result.Model as BlogEntry;

            Assert.AreEqual("UniqueTitle", blogEntry.Title);
        }
Example #2
0
 public void Post_Edit_Should_Update_Blog_Model()
 {
     var homeController = new HomeController();
     homeController.Create(new BlogEntry("UniqueTitle"));
     var blogEntry = HomeController.currentBlog.Entries.First();
     blogEntry.Body = "My Body";
     homeController.Edit(blogEntry);
     Assert.That(HomeController.currentBlog.Entries.First().Body, Is.EqualTo("My Body"));
 }