/// <exception cref="System.Security.SecurityException"></exception> /// <exception cref="System.MissingMethodException"></exception> public virtual void TestPrintWriterLogger() { ByteArrayOutputStream bout = new ByteArrayOutputStream(); PrintWriterLoggerInterceptor interceptor = new PrintWriterLoggerInterceptor(new PrintWriter (bout, true)); Logger.Intercept(interceptor); ILogging logger = Logger.Get(typeof(LoggingTestCase.ITestLogger)); ((LoggingTestCase.ITestLogger)logger.Debug()).Msg(); ((LoggingTestCase.ITestLogger)logger.Info()).Msg(); string actual = Platform4.AsUtf8(bout.ToByteArray()); string debugMsg = PrintWriterLoggerInterceptor.FormatMessage(Logger.Debug, "msg", null); string infoMsg = PrintWriterLoggerInterceptor.FormatMessage(Logger.Info, "msg", null ); Assert.IsTrue((actual.IndexOf(debugMsg) >= 0)); Assert.IsTrue((actual.IndexOf(infoMsg) >= 0)); }