예제 #1
0
        public void TestIsDebugEnabledForLoggable()
        {
            LogManager.Reset();
            LogManager.DefaultConfiguration.ClearTargets();
            LogManager.DefaultConfiguration.AddTarget(LogLevel.Info, LogLevel.Fatal, TestTarget.Current);

            // get a loggable...
            var loggable = new TestLoggable();

            // check...
            Assert.IsFalse(loggable.IsTraceEnabled());
            Assert.IsFalse(loggable.IsDebugEnabled());
            Assert.IsTrue(loggable.IsInfoEnabled());
            Assert.IsTrue(loggable.IsWarnEnabled());
            Assert.IsTrue(loggable.IsErrorEnabled());
            Assert.IsTrue(loggable.IsFatalEnabled());
        }