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

ShouldThrowExceptionWhenGetCommentByIdFails() private method

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