Пример #1
0
        public void TestRegexLookupCount()
        {
            Workshare.Policy.Condition.ContentAnalysis analysis = new Workshare.Policy.Condition.ContentAnalysis();
            string filename = Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute(@"\projects\Hygiene\src\ContentAnalysis.Tests\docs\TestDocument1.doc");
            string description = "Originally a test document used by one of FCS Lite's tests.";

            using (IFile testFile = Workshare.Policy.Engine.FileFactory.Create(filename, description))
            {
                string regEx = @"(The quick brown fox jumped over the lazy dog.){1}";
                string[] context = { "Paragraph", "HeaderOrFooter", "Comment", "Footnote", "Endnote", "TrackChange", "TextBox", "Reviewer", "HiddenText", "SmallText", "WhiteText", "AttachedTemplate", "SmartTag", "Version", "AutoVersion", "Field", "Hyperlink", "RoutingSlip", "Variable", "HiddenSlide", "SpeakerNote" };
                int regexCount = analysis.RegExLookupCount(testFile, regEx, context);

                Assert.AreEqual(1, regexCount, "Expected the value of regexCount to be [1], but was [" + regexCount + "]");
            }
        }