Blog.Logic.Core.Tests.EducationLogicTest.ShouldThrowExceptionWhenDeleteEducationFails C# (CSharp) Méthode

ShouldThrowExceptionWhenDeleteEducationFails() private méthode

private ShouldThrowExceptionWhenDeleteEducationFails ( ) : void
Résultat void
        public void ShouldThrowExceptionWhenDeleteEducationFails()
        {
            _educationRepository = new Mock<IEducationRepository>();
            _educationRepository.Setup(a => a.Delete(It.IsAny<Education>())).Throws(new Exception());

            _educationLogic = new EducationLogic(_educationRepository.Object);

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