Пример #1
0
        public void TestSingleColor()
        {
            colorRegexs[HighlightColor.ColorIndex.Red] = "(?i)^(FATAL|ERROR)";
            var processor = new HighlightProcessor(colorRegexs);
            processor.SetEnabled(true);

            var result = TestProcessorResults("Fatal [7:10:02pm] Some really bad happened", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.Red, result.HighlightColor);

            result = TestProcessorResults("Error [7:10:02pm] Some no as bad happened", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.Red, result.HighlightColor);

            result = TestProcessorResults("Info [7:10:02pm] nothing bad happened", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.None, result.HighlightColor);
        }
Пример #2
0
        public void TestMultipleColors()
        {
            colorRegexs[HighlightColor.ColorIndex.Red] = "(?i)^(FATAL|ERROR)";
            colorRegexs[HighlightColor.ColorIndex.Blue] = "(?i)^(INFO)";
            var processor = new HighlightProcessor(colorRegexs);
            processor.SetEnabled(true);

            var result = TestProcessorResults("Fatal [7:10:02pm] Some really bad happened", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.Red, result.HighlightColor);

            result = TestProcessorResults("Info [7:10:02pm] nothing bad happened", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.Blue, result.HighlightColor);

            result = TestProcessorResults("Warn [7:10:02pm] no color please", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.None, result.HighlightColor);
        }
Пример #3
0
        public void TestSingleColor()
        {
            colorRegexs[HighlightColor.ColorIndex.Red] = "(?i)^(FATAL|ERROR)";
            var processor = new HighlightProcessor(colorRegexs);

            processor.SetEnabled(true);

            var result = TestProcessorResults("Fatal [7:10:02pm] Some really bad happened", processor);

            Assert.AreEqual(HighlightColor.ColorIndex.Red, result.HighlightColor);

            result = TestProcessorResults("Error [7:10:02pm] Some no as bad happened", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.Red, result.HighlightColor);

            result = TestProcessorResults("Info [7:10:02pm] nothing bad happened", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.None, result.HighlightColor);
        }
Пример #4
0
        public void TestMultipleColors()
        {
            colorRegexs[HighlightColor.ColorIndex.Red]  = "(?i)^(FATAL|ERROR)";
            colorRegexs[HighlightColor.ColorIndex.Blue] = "(?i)^(INFO)";
            var processor = new HighlightProcessor(colorRegexs);

            processor.SetEnabled(true);

            var result = TestProcessorResults("Fatal [7:10:02pm] Some really bad happened", processor);

            Assert.AreEqual(HighlightColor.ColorIndex.Red, result.HighlightColor);

            result = TestProcessorResults("Info [7:10:02pm] nothing bad happened", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.Blue, result.HighlightColor);

            result = TestProcessorResults("Warn [7:10:02pm] no color please", processor);
            Assert.AreEqual(HighlightColor.ColorIndex.None, result.HighlightColor);
        }