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

ShouldThrowExceptionWhenSearchPostsFails() private method

private ShouldThrowExceptionWhenSearchPostsFails ( ) : void
return void
        public void ShouldThrowExceptionWhenSearchPostsFails()
        {
            _postRepository = new Mock<IPostRepository>();
            _postRepository.Setup(a => a.SearchPosts(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()))
                .Throws(new Exception("foo"));

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

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

            Assert.Throws<BlogException>(() => _postsLogic.SearchPosts("foo", 1, 1));
        }
PostsLogicTest