Blog.Logic.Core.Tests.PostLikesLogicTest.ShouldThrowExceptionWhenGetPostLikesFails C# (CSharp) Method

ShouldThrowExceptionWhenGetPostLikesFails() private method

private ShouldThrowExceptionWhenGetPostLikesFails ( ) : void
return void
        public void ShouldThrowExceptionWhenGetPostLikesFails()
        {
            _postLikeRepository = new Mock<IPostLikeRepository>();
            _postLikeRepository.Setup(a => a.Find(It.IsAny<Expression<Func<PostLike, bool>>>(), true))
                .Throws(new Exception());

            _postLikesLogic = new PostLikesLogic(_postLikeRepository.Object);

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