Exemplo n.º 1
0
        public void Test_DeleteComment_Call_Update_IsDeleted_True()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);

            //act
            servise.DeleteComment(2);

            //assert
            _comments.Verify(c => c.Update(It.Is<Comment>(comment => comment.IsDeleted)), Times.Once());
        }
Exemplo n.º 2
0
        public void Test_DeleteComment_Id_Less_Zero()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);

            //act
            servise.DeleteComment(-1);
        }
Exemplo n.º 3
0
        public void Test_DeleteComment_Call_Delete()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);

            //act
            servise.DeleteComment(1);

            //assert
            _comments.Verify( c => c.Delete(It.IsAny<Comment>()), Times.Once () );
        }