public PartialViewResult AddPost(string body) { var post = new Post() { AddedDate = System.DateTime.Now, Body = Sanitizer.GetSafeHtmlFragment(body) }; repo.Save(post); return PartialView("_Post", repo.GetAll()); }
public void CanAddPost() { var post = new Post() { AddedDate = System.DateTime.Now, Body = "test blog"}; IRepository<Post> repo = new PostRepository(); repo.Save(post); }