public void HandleWithNonExistingPolicyFiresInstrumentation() { ExceptionManager manager = new ExceptionManagerImpl(new Dictionary <string, ExceptionPolicyImpl>()); ((DefaultExceptionHandlingInstrumentationProvider)((IInstrumentationEventProvider)manager).GetInstrumentationEventProvider()) .exceptionHandlingErrorOccurred += (sender, args) => { firedEvent = args; }; try { manager.HandleException(new Exception(), "policy"); Assert.Fail("should have thrown"); } catch (ExceptionHandlingException) { Assert.IsNotNull(this.firedEvent); Assert.AreEqual("policy", this.firedEvent.PolicyName); } }
public void ExceptionHandlingErrorOccurred(object sender, DefaultExceptionHandlingErrorEventArgs e) { LogInternalError(e.PolicyName, e.Message); }
public void SetUp() { this.firedEvent = null; TestExceptionHandler.HandlingNames.Clear(); }