Exemplo n.º 1
0
        public void InfoDoesNotLogIfLogLevelDebugIsDisabled()
        {
            //given
            var target = new DefaultLogger(LogLevel.INFO, writeLineAction);

            // when
            target.Debug("Debug message");

            // then
            Assert.That(logOutputLines, Is.Empty);
        }
Exemplo n.º 2
0
        public void DebugDoesNotLogIfVerboseIsDisabled()
        {
            //given
            var target = new DefaultLogger(false, writeLineAction);

            // when
            target.Debug("Debug message");

            // then
            Assert.That(logOutputLines, Is.Empty);
        }
Exemplo n.º 3
0
        public void DebugLogsAppropriateMessage()
        {
            //given
            var target = new DefaultLogger(LogLevel.DEBUG, writeLineAction);

            // when
            target.Debug("Debug message");

            // then
            Assert.That(logOutputLines.Count, Is.EqualTo(1));
            Assert.That(Regex.IsMatch(logOutputLines[0], $"^{LoggerDateTimePattern} DEBUG \\[.+?\\] Debug message$"), Is.True);
        }