Blog.Logic.Core.Tests.CommentLikesLogicTest.ShouldThrowExceptionWhenGetCommentLikesFails C# (CSharp) Méthode

ShouldThrowExceptionWhenGetCommentLikesFails() private méthode

private ShouldThrowExceptionWhenGetCommentLikesFails ( ) : void
Résultat void
        public void ShouldThrowExceptionWhenGetCommentLikesFails()
        {
            _commentLikeRepository = new Mock<ICommentLikeRepository>();
            _commentLikeRepository.Setup(a => a.Find(It.IsAny<Expression<Func<CommentLike, bool>>>(), true))
                .Throws(new Exception());

            _commentLikesLogic = new CommentLikesLogic(_commentLikeRepository.Object);

            Assert.Throws<BlogException>(() => _commentLikesLogic.Get(1));
        }