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

ShouldThrowExceptionWhenAddPostContentFails() 개인적인 메소드

private ShouldThrowExceptionWhenAddPostContentFails ( ) : void
리턴 void
        public void ShouldThrowExceptionWhenAddPostContentFails()
        {
            _postContentRepository = new Mock<IPostContentRepository>();
            _postContentRepository.Setup(a => a.Add(It.IsAny<PostContent>())).Throws(new Exception());

            _postContentsLogic = new PostContentsLogic(_postContentRepository.Object);

            Assert.Throws<BlogException>(() => _postContentsLogic.Add(new Common.Contracts.PostContent()));
        }