Blog.Logic.Core.Tests.PostContentsLogicTest.ShouldThrowExceptionWhenDeletePostContentFails C# (CSharp) Method

ShouldThrowExceptionWhenDeletePostContentFails() private method

private ShouldThrowExceptionWhenDeletePostContentFails ( ) : void
return void
        public void ShouldThrowExceptionWhenDeletePostContentFails()
        {
            _postContentRepository = new Mock<IPostContentRepository>();
            _postContentRepository.Setup(a => a.Delete(It.IsAny<PostContent>())).Throws(new Exception());

            _postContentsLogic = new PostContentsLogic(_postContentRepository.Object);

            Assert.Throws<BlogException>(() => _postContentsLogic.Delete(1));
        }
    }