Esempio n. 1
0
        public void logging_adapter_property_test()
        {
            ILoggerAdapter adapter = new NoOpLoggerAdapter();

            LogManager.Adapter = adapter;

            LogManager.Adapter.Should().Be(adapter);
            Assert.Throws <ArgumentNullException>(delegate { LogManager.Adapter = null; });
        }
Esempio n. 2
0
        private static ILoggerAdapter GetDefaultFactory()
        {
            string message = string.Empty;

            if (ConfigurationReader.GetType() == typeof(DefaultConfigurationReader))
            {
                message = string.Format(
                    "no configuration section <{0}> found - suppressing logging output",
                    COMMON_LOGGING_SECTION);
            }
            else
            {
                message = string.Format(
                    "Custom ConfigurationReader '{0}' returned <null> - suppressing logging output",
                    ConfigurationReader.GetType().FullName);
            }
            Trace.WriteLine(message);

            ILoggerAdapter defaultFactory = new NoOpLoggerAdapter();

            return(defaultFactory);
        }