public void CancEditPost() { var manager = new AdminManager(); var postToEdit = manager.GetPostByID(manager.GetAllPosts().Count); postToEdit.PostTitle = "EditedPostTitle"; manager.EditPost(postToEdit); var editCheck = manager.GetPostByID(manager.GetAllPosts().Count); Assert.AreEqual(postToEdit.PostTitle,editCheck.PostTitle); }
public ActionResult EditPost(Post post) { //if (ModelState.IsValid) { var manager = new AdminManager(); post.PostDate = DateTime.Now; post.PostCategory.CategoryName = manager.GetCategoryByID(post.PostCategory.CategoryID).CategoryName; manager.EditPost(post); } return RedirectToAction("Index", "Home"); }