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

ShouldThrowExceptionWhenGetCommentsByUserFails() private method

private ShouldThrowExceptionWhenGetCommentsByUserFails ( ) : void
return void
        public void ShouldThrowExceptionWhenGetCommentsByUserFails()
        {
            _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.GetByUser(1));
        }