コード例 #1
0
        public void CanHandle_should_return_true_if_exception_can_be_handled()
        {
            var sut = new ExceptionFilters(new[]
            {
                new ExceptionFilter(ex => ex is ArgumentNullException)
            });

            var ex = new ArgumentNullException();

            sut.CanHandle(ex).Should().BeTrue();
        }
コード例 #2
0
        public void CanHandle_should_return_false_if_exception_cannot_be_handled()
        {
            var sut = new ExceptionFilters(new[]
            {
                new ExceptionFilter(ex => ex is ArgumentNullException)
            });

            var ex = new ApplicationException();

            sut.CanHandle(ex).Should().BeFalse();
        }