Esempio n. 1
0
        public void LoggingToManagerWithNoLoggersDoesNotFail()
        {
            var mgr = new LogCompositor();

            mgr.LogMessage("", LogLevel.Verbose, "Log message");
            mgr.LogException("", LogLevel.Error, "Log exception", new Exception());
        }
Esempio n. 2
0
        public void LoggingManagerCallsOnLogCallbacks()
        {
            var mgr = new LogCompositor();

            mgr.AddLoggingProvider(typeof(PluginLogger1));

            Assert.AreEqual(1, mgr.Loggers.Count);

            mgr.LogMessage("", LogLevel.Verbose, "Log message");
            mgr.LogException("", LogLevel.Error, "Log exception", new Exception());

            var plugin = (PluginLogger1)mgr.Loggers.First();

            Assert.AreEqual(1, plugin.LogMessageCallCount);
            Assert.AreEqual(1, plugin.LogExceptionCallCount);
        }