Esempio n. 1
0
        public void GetErrorFilterTest()
        {
            bool         enableMultiLine         = true;
            Regex        errRegex                = new Regex(@"(?s)<error>[\\s*]*(?<ErrorMessage>.*?)[\\s*]*</error>");
            OutputFilter errorFilter             = OutputFilter.GetErrorFilter(errRegex, enableMultiLine);
            const string ErrText                 = @"
* BEFORE *
* <error> *
* err1 *
* </error> *
* AFTER *
* <error>err2</error> * <error>err3</error> *
";
            var          expectedErrOutputChunks = new[]
            {
                @" *
* err1 *
* ",
                "err2",
                "err3"
            };

            var expectedErrOutput = string.Join(Environment.NewLine, expectedErrOutputChunks);

            XAssert.AreEqual(expectedErrOutput, errorFilter.ExtractMatches(ErrText));
        }
Esempio n. 2
0
        public void GetPipPropertyFilterTest()
        {
            bool         enableMultiLine            = true;
            OutputFilter propertyFilter             = OutputFilter.GetPipPropertiesFilter(enableMultiLine);
            const string OutputText                 = @"RandomTextPipProperty_SomeProp_123456_EndPropertyOtherRandomText";
            const string ExpectedPipPropertyMatches = @"SomeProp_123456";

            XAssert.AreEqual(ExpectedPipPropertyMatches, propertyFilter.ExtractMatches(OutputText));
        }
Esempio n. 3
0
        public void GetErrorFilterTest()
        {
            bool         enableMultiLine   = true;
            Regex        errRegex          = new Regex(@"(?s)<error>[\\s*]*(?<ErrorMessage>.*?)[\\s*]*</error>");
            OutputFilter errorFilter       = OutputFilter.GetErrorFilter(errRegex, enableMultiLine);
            const string ErrText           = @"
* BEFORE *
* <error> *
* err1 *
* </error> *
* AFTER *
* <error>err2</error> * <error>err3</error> *
";
            const string ExpectedErrOutput = @" *
* err1 *
* 
err2
err3";

            XAssert.AreEqual(ExpectedErrOutput, errorFilter.ExtractMatches(ErrText));
        }