Blog.Logic.Core.Tests.CommentsLogicTest.ShouldThrowExceptionWhenGetCommentReplyFails C# (CSharp) Method

ShouldThrowExceptionWhenGetCommentReplyFails() private method

private ShouldThrowExceptionWhenGetCommentReplyFails ( ) : void
return void
        public void ShouldThrowExceptionWhenGetCommentReplyFails()
        {
            _commentsRepository = new Mock<ICommentRepository>();
            _commentsRepository.Setup(a => a.Find(It.IsAny<Expression<Func<Comment, bool>>>(),
                It.IsAny<Func<IQueryable<Comment>, IOrderedQueryable<Comment>>>(), It.IsAny<string>()))
                .Throws(new Exception());

            _userRepository = new Mock<IUserRepository>();

            _commentsLogic = new CommentsLogic(_commentsRepository.Object, _userRepository.Object);

            Assert.Throws<BlogException>(() => _commentsLogic.GetReplies(5));
        }