Blog.Logic.Core.Tests.PostContentsLogicTest.ShouldThrowExceptionWhenGetPostContentByIdFails C# (CSharp) 메소드

ShouldThrowExceptionWhenGetPostContentByIdFails() 개인적인 메소드

private ShouldThrowExceptionWhenGetPostContentByIdFails ( ) : void
리턴 void
        public void ShouldThrowExceptionWhenGetPostContentByIdFails()
        {
            _postContentRepository = new Mock<IPostContentRepository>();
            _postContentRepository.Setup(a => a.Find(It.IsAny<Expression<Func<PostContent, bool>>>(), true))
                .Throws(new Exception());

            _postContentsLogic = new PostContentsLogic(_postContentRepository.Object);

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