public ActionResult EditPost(int id)
        {
            var manager = new AdminManager();
            var post = manager.GetPostByID(id);

            return View(post);
        }
Exemple #2
0
 public void CanGetPostById()
 {
     var manager = new AdminManager();
     var post = manager.GetPostByID(1);
     Assert.AreEqual(post.PostID,1);
 }
Exemple #3
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);
        }
Exemple #4
0
 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);
 }