Beispiel #1
0
        public void ShouldNotRethrowTheExceptionOnceHandledTest()
        {
            var target = new ErrorHandlingContext(this, ErrorSeverityLevel.NonFatal, new Exception());

            target.MarkErrorAsHandled();
            Assert.DoesNotThrow(() => target.RethrowErrorIfNotHandled());
        }
        /// <inheritdoc />
        public void Handle(Exception error, ErrorSeverityLevel severity)
        {
            if (error == null)
            {
                throw new ArgumentNullException(nameof(error));
            }

            var errorContext = new ErrorHandlingContext(this, severity, error);

            errorHandlingStrategy.Handle(errorContext);

            errorContext.RethrowErrorIfNotHandled();
        }
Beispiel #3
0
        public void ShouldRethrowTheExceptionTest()
        {
            var target = new ErrorHandlingContext(this, ErrorSeverityLevel.NonFatal, new Exception());

            Assert.Throws <Exception>(() => target.RethrowErrorIfNotHandled());
        }