예제 #1
0
 public void TestChangeConsoleLoggingLevelToWarn()
 {
     TestUtils.CheckOutput(
         action: () =>
     {
         LoggingHelper.ChangeConsoleLoggingLevel(VerbosityLevel.Warn);
         LoggingHelperTest.WriteLinesForAllLogLevels();
     },
         check: consoleOutput =>
     {
         using (var reader = new StringReader(consoleOutput.ToString()))
         {
             var output = reader.ReadToEnd();
             this.CheckLinesForAllLogLevels(output, new List <LogLevel> {
                 LogLevel.Warn
             });
         }
     });
 }
예제 #2
0
 public void TestChangeConsoleLoggingLevelToTrace()
 {
     TestUtils.CheckOutput(
         action: () =>
     {
         LoggingHelper.ChangeConsoleLoggingLevel(VerbosityLevel.Trace);
         LoggingHelperTest.WriteLinesForAllLogLevels();
     },
         check: consoleOutput =>
     {
         using (var reader = new StringReader(consoleOutput.ToString()))
         {
             this.CheckLinesForAllLogLevels(
                 reader.ReadToEnd(),
                 new List <LogLevel> {
                 LogLevel.Warn, LogLevel.Info, LogLevel.Debug, LogLevel.Trace
             });
         }
     });
 }