public void ReturnsNullWhenNotRegisteredUsingGeneric() { var exceptionService = new ExceptionService(); exceptionService.Register <ArgumentNullException>(exception => { }, null); Assert.IsNull(exceptionService.GetHandler <Exception>()); }
public void ReturnsNullWhenNotRegistered() { var exceptionService = new ExceptionService(); exceptionService.Register <ArgumentNullException>(exception => { }, null); Assert.IsNull(exceptionService.GetHandler(typeof(Exception))); }
public void ReturnsHandlerWhenRegisteredUsingGeneric() { var exceptionService = new ExceptionService(); exceptionService.Register <Exception>(exception => { }, null); exceptionService.Register <ArgumentNullException>(exception => { }, null); var handler = exceptionService.GetHandler <Exception>(); Assert.IsNotNull(handler); Assert.AreEqual(typeof(Exception), handler.ExceptionType); }
public void ReturnsHandlerWhenRegisteredUsingGeneric() { var exceptionService = new ExceptionService(); exceptionService.Register<Exception>(exception => { }); exceptionService.Register<ArgumentNullException>(exception => { }); var handler = exceptionService.GetHandler<Exception>(); Assert.IsNotNull(handler); Assert.AreEqual(typeof (Exception), handler.ExceptionType); }
public void ReturnsNullWhenNotRegisteredUsingGeneric() { var exceptionService = new ExceptionService(); exceptionService.Register<ArgumentNullException>(exception => { }); Assert.IsNull(exceptionService.GetHandler<Exception>()); }
public void ReturnsNullWhenNotRegistered() { var exceptionService = new ExceptionService(); exceptionService.Register<ArgumentNullException>(exception => { }); Assert.IsNull(exceptionService.GetHandler(typeof (Exception))); }
public void ReturnsArgumentNullException() { var exceptionService = new ExceptionService(); ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => exceptionService.GetHandler(null)); }
public void ReturnsArgumentNullException() { var exceptionService = new ExceptionService(); ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => exceptionService.GetHandler(null)); }