public void CustomHandlerTest()
        {
            MockExceptionHandler.Clear();
            Exception originalException = new ArgumentNullException();
            Exception customException   = null;

            try
            {
                ExceptionPolicy.HandleException(originalException, "Custom Policy");
            }
            catch (Exception ex)
            {
                customException = ex;
            }
            Assert.IsNotNull(customException);
            Assert.AreEqual(2, MockExceptionHandler.attributes.Count);
            Assert.AreEqual("32", MockExceptionHandler.attributes["Age"]);
            Assert.AreEqual(typeof(ArgumentNullException), customException.GetType());
            MockExceptionHandler.Clear();
        }
Exemplo n.º 2
0
 public void Setup()
 {
     MockExceptionHandler.Clear();
 }
 public void Cleanup()
 {
     ExceptionPolicy.Reset();
     MockExceptionHandler.Clear();
 }