Blog.Logic.Core.Tests.CommunityLogicTest.ShouldThrowExceptionWhenGetCommunityByIdFails C# (CSharp) 메소드

ShouldThrowExceptionWhenGetCommunityByIdFails() 개인적인 메소드

private ShouldThrowExceptionWhenGetCommunityByIdFails ( ) : void
리턴 void
        public void ShouldThrowExceptionWhenGetCommunityByIdFails()
        {
            _communityRepository = new Mock<ICommunityRepository>();
            _communityRepository.Setup(a => a.Get(It.IsAny<int>())).Throws(new Exception("Hooha!"));

            var logic = new CommunityLogic(_communityRepository.Object);

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