Ejemplo n.º 1
0
        public void ForwardingWriter_Write_WritesToInnerLogger()
        {
            var list       = new List <LogEvent>();
            var listWriter = new ListLogWriter(list, 10);
            var policy     = new LogPolicy()
            {
                LogWriter = listWriter
            };
            var innerLogger = new Logger(policy);
            var writer      = new ForwardingLogWriter(innerLogger);

            var logEvent = new LogEvent()
            {
                EventName = "Test log event."
            };

            writer.Write(logEvent);

            Assert.AreEqual(1, list.Count);
            Assert.AreEqual("Test log event.", list[0].EventName);
        }
Ejemplo n.º 2
0
 public void ForwardingWriter_Constructor_ThrowsOnNullLogger()
 {
     var writer = new ForwardingLogWriter(null);
 }