Exemple #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);
        }
Exemple #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();
        }