Blog.Logic.Core.Tests.PostsLogicTest.ShouldThrowExceptionWhenGetRelatedPostsFails C# (CSharp) Method

ShouldThrowExceptionWhenGetRelatedPostsFails() private method

private ShouldThrowExceptionWhenGetRelatedPostsFails ( ) : void
return void
        public void ShouldThrowExceptionWhenGetRelatedPostsFails()
        {
            _postRepository = new Mock<IPostRepository>();
            _postRepository.Setup(a => a.Find(It.IsAny<Expression<Func<Post, bool>>>(),
                It.IsAny<Func<IQueryable<Post>, IOrderedQueryable<Post>>>(), It.IsAny<string>()))
                .Throws(new Exception());

            _postContentRepository = new Mock<IPostContentRepository>();
            _mediaRepository = new Mock<IMediaRepository>();

            _postsLogic = new PostsLogic(_postRepository.Object, _postContentRepository.Object,
                _mediaRepository.Object);

            Assert.Throws<BlogException>(() => _postsLogic.GetRelatedPosts(1));
        }
PostsLogicTest