public void GivenAppExceptionRuleWhenDerivedFromDerivativeExceptionProvidedThenShouldAdviceToHandle() { // Arrange var sut = new ExceptionRuleForErrorProvider <ApplicationExceptionBase>(); var exception = new OurDerivedApplicationException("Error"); // Act var result = sut.CanHandle(exception); // Assert Assert.True(result); }
public void GivenAppExceptionRuleWhenUnknownExceptionProvidedThenShouldAdviceToSkip() { // Arrange var sut = new ExceptionRuleForErrorProvider <ApplicationExceptionBase>(); var exception = new ThirdPartyFailureException("Error"); // Act var result = sut.CanHandle(exception); // Assert Assert.False(result); }
public void GivenAppExceptionRuleWhenDerivedExceptionProvidedAndPredicateMatchesThenShouldAdviceToHandle() { // Arrange var sut = new ExceptionRuleForErrorProvider <ApplicationExceptionBase>(f => f.Message.Contains("rr")); var exception = new OurApplicationException("Error"); // Act var result = sut.CanHandle(exception); // Assert Assert.True(result); }