コード例 #1
0
        public FallbackAppenderProxyBase(IAppender appenderToWrap)
        {
            var convertedAppender = appenderToWrap as AppenderSkeleton;
            if (convertedAppender == null)
                throw new InvalidOperationException("cannot use IndefiniteAppenderProxy with an appender that does not inherit from AppenderSkeleton as it needs to hook into the IErrorHandler, to gather errors.");

            innerAppender = convertedAppender;
            errorHandler = new RecordingErrorHandler(GetType().Name);
            convertedAppender.ErrorHandler = errorHandler;
        }
コード例 #2
0
 public void should_record_as_an_error()
 {
     var sut = new RecordingErrorHandler("prefix");
     sut.Error("foo", new Exception("foo"), ErrorCode.GenericFailure);
     Assert.That(sut.HasError, Iz.True);
 }
コード例 #3
0
 public void should_record_as_an_error()
 {
     var sut = new RecordingErrorHandler("prefix");
     sut.Error("foo");
     Assert.That(sut.HasError, Iz.True);
 }