Blog.Logic.Core.Tests.CommunityLogicTest.ShouldThrowExceptionWhenDeletingCommunityFailsOnGettingRecord C# (CSharp) Method

ShouldThrowExceptionWhenDeletingCommunityFailsOnGettingRecord() private method

        public void ShouldThrowExceptionWhenDeletingCommunityFailsOnGettingRecord()
        {
            _communityRepository = new Mock<ICommunityRepository>();
            _communityRepository.Setup(a => a.Delete(It.IsAny<Community>()));
            _communityRepository.Setup(a => a.Find(It.IsAny<Expression<Func<Community, bool>>>(), false))
                .Throws(new Exception("Hooha!"));


            var logic = new CommunityLogic(_communityRepository.Object);

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