public void LoggingSettingsNodeTest()
        {
            LoggingSettingsNode node = new LoggingSettingsNode();

            ApplicationNode.AddNode(node);
            bool logWarningWhenNoCategoriesMatch = true;
            bool tracingEnabled = true;

            node.LogWarningWhenNoCategoriesMatch = logWarningWhenNoCategoriesMatch;
            Assert.AreEqual(logWarningWhenNoCategoriesMatch, node.LogWarningWhenNoCategoriesMatch);
            node.TracingEnabled = tracingEnabled;
            Assert.AreEqual(tracingEnabled, node.TracingEnabled);
            LoggingSettingsBuilder builder = new LoggingSettingsBuilder(ServiceProvider, node);
            LoggingSettings        data    = builder.Build();

            Assert.AreEqual("Logging Application Block", data.Name);
            Assert.AreEqual(logWarningWhenNoCategoriesMatch, data.LogWarningWhenNoCategoriesMatch);
            Assert.AreEqual(tracingEnabled, data.TracingEnabled);
        }
Пример #2
0
        public void LoggingSettingsNodeTest()
        {
            LoggingSettingsNode node = new LoggingSettingsNode();
            ApplicationNode.AddNode(node);

            bool logWarningWhenNoCategoriesMatch = true;
            bool tracingEnabled = true;

            node.LogWarningWhenNoCategoriesMatch = logWarningWhenNoCategoriesMatch;
            Assert.AreEqual(logWarningWhenNoCategoriesMatch, node.LogWarningWhenNoCategoriesMatch);

            node.TracingEnabled = tracingEnabled;
            Assert.AreEqual(tracingEnabled, node.TracingEnabled);

            LoggingSettingsBuilder builder = new LoggingSettingsBuilder(ServiceProvider, node);
            LoggingSettings data = builder.Build();
            Assert.AreEqual("Logging Application Block", data.Name);
            Assert.AreEqual(logWarningWhenNoCategoriesMatch, data.LogWarningWhenNoCategoriesMatch);
            Assert.AreEqual(tracingEnabled, data.TracingEnabled);
        }