예제 #1
0
        public void ConfiguredInfoLogLevelIsPopulatedToNlog()
        {
            _loggingOptions.LogTargets.Add(new LogTarget(LogTargetType.Console, LogLevel.Information));

            LoggingConfiguration nlogConfig = NlogConfigurationFactory.Create(_loggingOptions);

            LoggingRule loggingRule = nlogConfig.LoggingRules[0];

            loggingRule.Should().NotBeNull();
            loggingRule.Levels.FirstOrDefault().Should().Be(NLog.LogLevel.Info);
        }
예제 #2
0
        public void ConfiguredOffLogLevelIsPromotedToNlog()
        {
            _loggingOptions.LogTargets.Add(new LogTarget(LogTargetType.Console, LogLevel.None));

            LoggingConfiguration nlogConfig = NlogConfigurationFactory.Create(_loggingOptions);

            LoggingRule loggingRule = nlogConfig.LoggingRules[0];

            loggingRule.Should().NotBeNull();
            loggingRule.Levels.Should().BeEmpty();
        }