This implements the exception treatment mechanics.
Inheritance: IExceptionHandler
Example #1
0
            public void PerformsHandle()
            {
                var originalException = new ArgumentException("achieved");
                var message = string.Empty;
                var handler = new ExceptionHandler(typeof (ArgumentException), exception => { message = exception.Message; });
                handler.Handle(originalException);

                Assert.AreEqual("achieved", message);
            }
Example #2
0
 public void ThrowsArgumentNullExceptionForHandleNullParameter()
 {
     var handler = new ExceptionHandler(typeof (Exception), exception => { });
     ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => handler.Handle(null));
 }
Example #3
0
 public void SetTypeValueInExceptionProperty()
 {
     var type = typeof (Exception);
     var handler = new ExceptionHandler(type, exception => { });
     Assert.AreEqual(type, handler.ExceptionType);
 }