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

ShouldThrowExceptionWhenGetJoinedCommunityListFails() 개인적인 메소드

        public void ShouldThrowExceptionWhenGetJoinedCommunityListFails()
        {
            _communityRepository = new Mock<ICommunityRepository>();
            _communityRepository.Setup(a => a.GetJoinedCommunitiesByUser(It.IsAny<int>(), It.IsAny<int>()))
                    .Throws(new Exception("Hooha!"));

            var logic = new CommunityLogic(_communityRepository.Object);

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