コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public void ExceptionHandlingErrorOccurred(object sender, DefaultExceptionHandlingErrorEventArgs e)
 {
     LogInternalError(e.PolicyName, e.Message);
 }
コード例 #3
0
 public void SetUp()
 {
     this.firedEvent = null;
     TestExceptionHandler.HandlingNames.Clear();
 }