예제 #1
0
        public void TestWritesInInfoMode()
        {
            var log = new RollingMemoryLog(Severity.Diagnostic);

            using var logger = new Logger(synchronous: true, log);
            var context = new Context(logger);

            var twa = new TextWriterAdapter(context, Severity.Info);

            twa.WriteLine("Hello World!");
            log.RecentEntries(1).First().Should().Contain("Hello World!");
        }
예제 #2
0
        public void TestNewLinesAndSingleCharsAreIgnored()
        {
            var log = new RollingMemoryLog(Severity.Diagnostic);

            using var logger = new Logger(synchronous: true, log);
            var context = new Context(logger);

            var twa = new TextWriterAdapter(context, Severity.Info);

            twa.WriteLine();
            twa.WriteLine();
            twa.WriteLine();
            twa.Write('H');
            twa.Write('e');
            twa.Write('l');
            twa.Write('l');
            twa.Write('o');
            log.RecentEntries(1).Should().BeEmpty();
        }