public void TestStep1()
        {
            string badChars, removedWords;
            var    s1 = FullTextSearchUtils.PrepareSearchCriteriaStep1("word", out badChars, out removedWords);

            Assert.AreEqual("word", s1);
            Assert.AreEqual(null, badChars);
            Assert.AreEqual(null, removedWords);

            s1 = FullTextSearchUtils.PrepareSearchCriteriaStep1("word word2  ", out badChars, out removedWords);
            Assert.AreEqual("word word2", s1);
            Assert.AreEqual(null, badChars);
            Assert.AreEqual(null, removedWords);

            s1 = FullTextSearchUtils.PrepareSearchCriteriaStep1("word a word2", out badChars, out removedWords);
            Assert.AreEqual("word word2", s1);
            Assert.AreEqual("a", badChars);
            Assert.AreEqual(null, removedWords);

            s1 = FullTextSearchUtils.PrepareSearchCriteriaStep1("word \"a\" word2", out badChars, out removedWords);
            Assert.AreEqual("word \"a\" word2", s1);
            Assert.AreEqual(null, badChars);
            Assert.AreEqual(null, removedWords);

            s1 = FullTextSearchUtils.PrepareSearchCriteriaStep1("not  word or word2 about near", out badChars, out removedWords);
            Assert.AreEqual("word word2", s1);
            Assert.AreEqual(null, badChars);
            Assert.AreEqual("not, or, about, near", removedWords);
        }
        public void TestSimple()
        {
            string badChars, removedWords;
            var    s1 = FullTextSearchUtils.PrepareSearchCriteriaStep1(" word1 OR w2 word3 NOT  a about test - evaluate //x1", out badChars, out removedWords);
            var    s2 = FullTextSearchUtils.BuildSearchTextExpressionSimple(s1);

            Assert.AreEqual("/, /,a,-", badChars);
            Assert.AreEqual("OR, NOT, about", removedWords);

            Assert.AreEqual("word1 w2 word3 test evaluate x1", s1);
            Assert.AreEqual("word1 AND w2 AND word3 AND test AND evaluate AND x1", s2);

            Assert.AreEqual(null, FullTextSearchUtils.PrepareSearchCriteriaStep1(null, out badChars, out removedWords));
            Assert.AreEqual("", FullTextSearchUtils.PrepareSearchCriteriaStep1("", out badChars, out removedWords));

            Assert.AreEqual(null, FullTextSearchUtils.BuildSearchTextExpressionSimple(null));
            Assert.AreEqual("", FullTextSearchUtils.BuildSearchTextExpressionSimple(""));
            Assert.AreEqual("", FullTextSearchUtils.BuildSearchTextExpressionSimple("  "));

            Assert.AreEqual("word1 AND word2", FullTextSearchUtils.BuildSearchTextExpressionSimple("word1,word2"));
            Assert.AreEqual("word1 AND word2", FullTextSearchUtils.BuildSearchTextExpressionSimple("word1;;word2"));
            Assert.AreEqual("word1 AND word2", FullTextSearchUtils.BuildSearchTextExpressionSimple("word1.word2"));

            Assert.AreEqual("\"word1,word2\"", FullTextSearchUtils.BuildSearchTextExpressionSimple("  \"word1,word2\""));
            Assert.AreEqual("\"word1;word2\"", FullTextSearchUtils.BuildSearchTextExpressionSimple("\"word1;;word2\"  "));
            Assert.AreEqual("\"wor d1.word2\"", FullTextSearchUtils.BuildSearchTextExpressionSimple("\"wor  d1.word2\" "));

            Assert.AreEqual("\"some phraze\" AND word% AND (1 AND 2)", FullTextSearchUtils.BuildSearchTextExpressionSimple("\"some phraze\"  word* (1 2)"));
            Assert.AreEqual("\"a;\"", FullTextSearchUtils.BuildSearchTextExpressionSimple("\"a;;\""));
            Assert.AreEqual("ab%%", FullTextSearchUtils.BuildSearchTextExpressionSimple("ab**"));
        }