Example #1
0
        public void Should_disregard_log_level_when_colors_are_not_supported()
        {
            var settings = GetSettings();

            var logEventInfo  = CreateEvent(LogLevel.Info);
            var logEventDebug = CreateEvent(LogLevel.Debug);
            var logEventError = CreateEvent(LogLevel.Error);
            var logEventWarn  = CreateEvent(LogLevel.Warn);
            var logEventFatal = CreateEvent(LogLevel.Fatal);

            var logInfos = new[]
            {
                new LogEventInfo(logEventInfo, settings),
                new LogEventInfo(logEventDebug, settings),
                new LogEventInfo(logEventError, settings),
                new LogEventInfo(logEventWarn, settings),
                new LogEventInfo(logEventFatal, settings),
            };

            batcherWithRedirectedOutput.BatchEvents(logInfos, logInfos.Length).Should().HaveCount(1);
        }
Example #2
0
        public void Should_not_group_events_with_different_log_levels_if_colors_are_enabled()
        {
            var settings = new ConsoleLogSettings {
                ColorsEnabled = true
            };

            var events = new[]
            {
                new LogEventInfo(CreateEvent(LogLevel.Info), settings),
                new LogEventInfo(CreateEvent(LogLevel.Warn), settings)
            };

            batcher.BatchEvents(events, 2).Should().HaveCount(2);
        }