Beispiel #1
0
            public void ReturnsFalseWhenNotRegisteredUsingGeneric()
            {
                var exceptionService = new ExceptionService();

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

                Assert.IsFalse(exceptionService.IsExceptionRegistered <Exception>());
            }
Beispiel #2
0
            public void ReturnsFalseWhenNotRegistered()
            {
                var exceptionService = new ExceptionService();

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

                Assert.IsFalse(exceptionService.IsExceptionRegistered(typeof(Exception)));
            }
            public void ReturnsTrueWhenRegistered()
            {
                var exceptionService = new ExceptionService();

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

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

                Assert.IsTrue(exceptionService.IsExceptionRegistered(typeof(ArgumentNullException)));
            }
            public void ReturnsTrueWhenRegisteredUsingGeneric()
            {
                var exceptionService = new ExceptionService();

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

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

                Assert.IsTrue(exceptionService.IsExceptionRegistered<Exception>());
            }
            public void ReturnsTrueWhenRegistered()
            {
                var exceptionService = new ExceptionService();

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

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

                Assert.IsTrue(exceptionService.IsExceptionRegistered(typeof (ArgumentNullException)));
            }
            public void ReturnsArgumentNullException()
            {
                var exceptionService = new ExceptionService();

                ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => exceptionService.IsExceptionRegistered(null));
            }
Beispiel #7
0
            public void ReturnsArgumentNullException()
            {
                var exceptionService = new ExceptionService();

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