Ejemplo n.º 1
0
        public void LogRuleToStringTest_none()
        {
            var target = new FileTarget {
                Name = "file1"
            };
            var loggingRule = new LoggingRule("*", target);
            var s           = loggingRule.ToString();

            Assert.Equal("logNamePattern: (:All) levels: [ ] appendTo: [ file1 ]", s);
        }
Ejemplo n.º 2
0
        public void LogRuleToStringTest_filter()
        {
            var target = new FileTarget {
                Name = "file1"
            };
            var loggingRule = new LoggingRule("namespace.comp1", target);
            var s           = loggingRule.ToString();

            Assert.Equal("logNamePattern: (namespace.comp1:Equals) levels: [ ] appendTo: [ file1 ]", s);
        }
Ejemplo n.º 3
0
        public void LogRuleToStringTest_minAndMax()
        {
            var target = new FileTarget {
                Name = "file1"
            };
            var loggingRule = new LoggingRule("*", LogLevel.Debug, LogLevel.Error, target);
            var s           = loggingRule.ToString();

            Assert.Equal("logNamePattern: (:All) levels: [ Debug Info Warn Error ] appendTo: [ file1 ]", s);
        }
Ejemplo n.º 4
0
        public void LogRuleToStringTest_multiple_targets()
        {
            var target = new FileTarget {
                Name = "file1"
            };
            var target2 = new FileTarget {
                Name = "file2"
            };
            var loggingRule = new LoggingRule("namespace.comp1", target);

            loggingRule.Targets.Add(target2);
            var s = loggingRule.ToString();

            Assert.Equal("logNamePattern: (namespace.comp1:Equals) levels: [ ] appendTo: [ file1 file2 ]", s);
        }