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

ShouldThrowExceptionWhenGetPostsByCommunityFails() private method

private ShouldThrowExceptionWhenGetPostsByCommunityFails ( ) : void
return void
        public void ShouldThrowExceptionWhenGetPostsByCommunityFails()
        {
            _postRepository = new Mock<IPostRepository>();
            _postRepository.Setup(a => a.GetByCommunity(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>()))
                .Throws(new Exception());

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

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

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