public void ShouldThrowExceptionWhenGetPostByIdFails()
{
_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());
var postContents = _postContents.Where(a => a.PostId == 1).ToList();
_postContentRepository = new Mock<IPostContentRepository>();
_postContentRepository.Setup(a => a.Find(It.IsAny<Expression<Func<PostContent, bool>>>(), true))
.Returns(postContents);
_mediaRepository = new Mock<IMediaRepository>();
_postsLogic = new PostsLogic(_postRepository.Object, _postContentRepository.Object,
_mediaRepository.Object);
Assert.Throws<BlogException>(() => _postsLogic.GetPost(1));
}