Ejemplo n.º 1
0
        public void DeletePostFailed()
        {
            int numberOfOldPosts = PostDB.GetAllPosts(active).Count;

            PostDB.DeletePost(Guid.NewGuid());
            Assert.AreEqual(numberOfOldPosts, PostDB.GetAllPosts(active).Count);
        }
Ejemplo n.º 2
0
        public void DeletePostSuccess()
        {
            Guid id = PostDB.GetAllPosts(active)[0].Id;

            PostDB.DeletePost(id);
            Assert.AreEqual(PostDB.GetPost(id).Active, false);
        }
Ejemplo n.º 3
0
        public void DeletePostFailed()
        {
            int numberOfOldPosts = PostDB.GetPosts(active).Count;

            PostDB.DeletePost(123);
            Assert.AreEqual(numberOfOldPosts, PostDB.GetPosts(active).Count);
        }
Ejemplo n.º 4
0
        public IHttpActionResult Delete(int id)
        {
            int val = PostDB.DeletePost(id);

            if (val > 0)
            {
                return(Ok($"Post with id {id} Successfully deleted!"));
            }
            else
            {
                return(Content(HttpStatusCode.NotFound, $"Post with id {id}  was not found to delete!!!"));
            }
        }
Ejemplo n.º 5
0
 public void DeletePost(Guid id)
 {
     PostDB.DeletePost(id);
 }
Ejemplo n.º 6
0
 public void DeletePost(int id)
 {
     PostDB.DeletePost(id);
 }