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

ShouldThrowExceptionWhenGetPostsForUserFailsOnPostsLookup() private method

        public void ShouldThrowExceptionWhenGetPostsForUserFailsOnPostsLookup()
        {
            _postRepository = new Mock<IPostRepository>();
            _postRepository.Setup(a => a.GetPostsForUser(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.GetPostsForUser(1, 5, 5));
        }
PostsLogicTest