示例#1
0
            public void ReturnsNullWhenNotRegisteredUsingGeneric()
            {
                var exceptionService = new ExceptionService();

                exceptionService.Register <ArgumentNullException>(exception => { }, null);

                Assert.IsNull(exceptionService.GetHandler <Exception>());
            }
示例#2
0
            public void ReturnsNullWhenNotRegistered()
            {
                var exceptionService = new ExceptionService();

                exceptionService.Register <ArgumentNullException>(exception => { }, null);

                Assert.IsNull(exceptionService.GetHandler(typeof(Exception)));
            }
示例#3
0
            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);
            }
示例#4
0
            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);
            }
示例#5
0
            public void ReturnsNullWhenNotRegisteredUsingGeneric()
            {
                var exceptionService = new ExceptionService();

                exceptionService.Register<ArgumentNullException>(exception => { });

                Assert.IsNull(exceptionService.GetHandler<Exception>());
            }
示例#6
0
            public void ReturnsNullWhenNotRegistered()
            {
                var exceptionService = new ExceptionService();

                exceptionService.Register<ArgumentNullException>(exception => { });

                Assert.IsNull(exceptionService.GetHandler(typeof (Exception)));
            }
示例#7
0
            public void ReturnsArgumentNullException()
            {
                var exceptionService = new ExceptionService();

                ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => exceptionService.GetHandler(null));
            }
示例#8
0
            public void ReturnsArgumentNullException()
            {
                var exceptionService = new ExceptionService();

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => exceptionService.GetHandler(null));
            }