public void TestDebugForLoggable()
        {
            TestTarget.Current.Reset();

            // run...
            var loggable = new TestLoggable();
            loggable.LogDebug("Hello, world.");

            // check...
            Assert.AreEqual(1, TestTarget.Current.NumWritten);
            Assert.AreEqual(LogLevel.Debug, TestTarget.Current.LastWritten.Level);
            Assert.IsNull(TestTarget.Current.LastWritten.Exception);
        }
        public void TestDebugForLoggableWithFormat()
        {
            TestTarget.Current.Reset();

            // run...
            var loggable = new TestLoggable();
            loggable.LogDebug("Hello, {0}.", "**foo**");

            // check...
            Assert.AreEqual(1, TestTarget.Current.NumWritten);
            Assert.AreEqual(LogLevel.Debug, TestTarget.Current.LastWritten.Level);
            Assert.IsNull(TestTarget.Current.LastWritten.Exception);
            Assert.AreNotEqual(-1, TestTarget.Current.LastWritten.Message.IndexOf("**foo**"));
        }
        public void TestDebugForLoggableWithException()
        {
            TestTarget.Current.Reset();

            // run...
            var loggable = new TestLoggable();
            loggable.LogDebug("Hello, world", new InvalidOperationException("Foobar"));

            // check...
            Assert.AreEqual(1, TestTarget.Current.NumWritten);
            Assert.AreEqual(LogLevel.Debug, TestTarget.Current.LastWritten.Level);
            Assert.IsNotNull(TestTarget.Current.LastWritten.Exception);
        }