コード例 #1
0
        public void trace_with_exception()
        {

            var sut = new BaseLoggerWrapper(GetType());
            sut.Trace("Hello", new ExternalException());

            Assert.AreEqual(sut.Entries.Count, 1);
            Assert.AreEqual(sut.Entries[0].Message, "Hello");
            Assert.AreEqual(sut.Entries[0].LogLevel, LogLevel.Trace);
            Assert.IsInstanceOfType(sut.Entries[0].Exception, typeof(ExternalException));
        }
コード例 #2
0
        public void trace_formatted()
        {

            var sut = new BaseLoggerWrapper(GetType());
            sut.Trace("Hello {0}", "World");

            Assert.AreEqual(sut.Entries.Count, 1);
            Assert.AreEqual(sut.Entries[0].Message, "Hello World");
            Assert.AreEqual(sut.Entries[0].LogLevel, LogLevel.Trace);
            Assert.AreEqual(sut.Entries[0].Exception, null);
        }
コード例 #3
0
        public void trace_without_exception()
        {

            var sut = new BaseLoggerWrapper(GetType());
            sut.Trace("Hello");

            Assert.AreEqual(sut.Entries.Count, 1);
            Assert.AreEqual(sut.Entries[0].Message, "Hello");
            Assert.AreEqual(sut.Entries[0].LogLevel, LogLevel.Trace);
            Assert.AreEqual(sut.Entries[0].Exception, null);
        }
コード例 #4
0
        public void trace_with_exception()
        {
            var sut = new BaseLoggerWrapper(GetType());

            sut.Trace("Hello", new ExternalException());

            Assert.AreEqual(sut.Entries.Count, 1);
            Assert.AreEqual(sut.Entries[0].Message, "Hello");
            Assert.AreEqual(sut.Entries[0].LogLevel, LogLevel.Trace);
            Assert.IsInstanceOfType(sut.Entries[0].Exception, typeof(ExternalException));
        }
コード例 #5
0
        public void trace_formatted()
        {
            var sut = new BaseLoggerWrapper(GetType());

            sut.Trace("Hello {0}", "World");

            Assert.AreEqual(sut.Entries.Count, 1);
            Assert.AreEqual(sut.Entries[0].Message, "Hello World");
            Assert.AreEqual(sut.Entries[0].LogLevel, LogLevel.Trace);
            Assert.AreEqual(sut.Entries[0].Exception, null);
        }
コード例 #6
0
        public void trace_without_exception()
        {
            var sut = new BaseLoggerWrapper(GetType());

            sut.Trace("Hello");

            Assert.AreEqual(sut.Entries.Count, 1);
            Assert.AreEqual(sut.Entries[0].Message, "Hello");
            Assert.AreEqual(sut.Entries[0].LogLevel, LogLevel.Trace);
            Assert.AreEqual(sut.Entries[0].Exception, null);
        }