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; }
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); }
public void should_record_as_an_error() { var sut = new RecordingErrorHandler("prefix"); sut.Error("foo"); Assert.That(sut.HasError, Iz.True); }