Esempio n. 1
0
 public ActionResult DeletePost(Post post)
 {
     //if (ModelState.IsValid)
     {
         var manager = new AdminManager();
         manager.DeletePost(post);
     }
     return RedirectToAction("Index", "Home");
 }
Esempio n. 2
0
        public void CanDeletePost()
        {
            var manager = new AdminManager();
            var postCount = manager.GetAllPosts().Count;
            var toDelete = manager.GetPostByID(postCount);

            manager.DeletePost(toDelete);
            Assert.AreEqual(postCount - 1, manager.GetAllPosts().Count);
        }