コード例 #1
0
        public void Should_not_log_warnings_if_loglevel_is_error(
            [Frozen] LogLevel level,
            Func <string> getMessage,
            ICastleLogger logger)
        {
            new LoggerWithLevels(logger, level).Warn(getMessage);

            logger.DidNotReceive().Warn(getMessage());
        }
コード例 #2
0
        public void Should_not_log_info_if_loglevel_is_warn_or_lower(
            [Frozen] LogLevel level,
            Func <string> getMessage,
            ICastleLogger logger)
        {
            new LoggerWithLevels(logger, level).Info(getMessage);

            logger.DidNotReceive().Info(getMessage());
        }
コード例 #3
0
        public void Should_not_log_when_level_is_none(
            Func <string> getMessage,
            ICastleLogger castleLogger)
        {
            var logger = new LoggerWithLevels(castleLogger, LogLevel.None);

            logger.Info(getMessage);
            logger.Warn(getMessage);
            logger.Error(getMessage);

            castleLogger.DidNotReceive().Info(getMessage());
        }