コード例 #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));
            }