Blog.Logic.Core.Tests.CommentLikesLogicTest.ShouldThrowExceptionWhenAddCommentLikeFails C# (CSharp) Method

ShouldThrowExceptionWhenAddCommentLikeFails() private method

private ShouldThrowExceptionWhenAddCommentLikeFails ( ) : void
return void
        public void ShouldThrowExceptionWhenAddCommentLikeFails()
        {
            _commentLikeRepository = new Mock<ICommentLikeRepository>();
            _commentLikeRepository.Setup(a => a.Find(It.IsAny<Expression<Func<CommentLike, bool>>>(), false))
                .Throws(new Exception());

            _commentLikesLogic = new CommentLikesLogic(_commentLikeRepository.Object);

            Assert.Throws<BlogException>(() => _commentLikesLogic.Add(new Common.Contracts.CommentLike()));
        }
    }