Exemple #1
0
        public void DeleteCommentOrLike()
        {
            int postCommentOrLikeId = 1;

            _postsRepoMock.Setup(m => m.DeleteComment(postCommentOrLikeId, _loginUser.UserId)).Returns(true);
            PostController controller = new PostController(_postsRepoMock.Object, _loginUser);

            JsonResult result = controller.DeleteCommentOrLike(postCommentOrLikeId);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Data);
            Assert.IsTrue(result.Data is JsonResponseVM);
            Assert.IsTrue((result.Data as JsonResponseVM).Result == "OK");
        }