예제 #1
0
        public void SearchTermIteratorTestFour()
        {
            var terms = SearchTermIterator.GetInstance("one two three four");

            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("one two three four", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("one two three", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("two three four", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("one two", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("two three", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("three four", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("one", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("two", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("three", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("four", terms.Next());
            Assert.IsFalse(terms.HasNext());
        }
예제 #2
0
        public void SearchTermIteratorTestOne()
        {
            var terms = SearchTermIterator.GetInstance("test");

            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("test", terms.Next());
            Assert.IsFalse(terms.HasNext());
        }
예제 #3
0
        public void TestStringRemovingPunctuation()
        {
            var terms = SearchTermIterator.GetInstance("this:  Is my, string");

            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("this Is my string", terms.Next());
            Assert.IsTrue(terms.HasNext());
        }
예제 #4
0
        public void SearchTermIteratorTestFiveRemovingExtraSpace()
        {
            var terms = SearchTermIterator.GetInstance("one two three four  five");

            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("one two three four five", terms.Next());
            Assert.IsTrue(terms.HasNext());
        }
예제 #5
0
        public void MahiMahiHitTest()
        {
            var terms = SearchTermIterator.GetInstance("mahi mahi");

            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("mahi mahi", terms.Next());
            terms.ReportHit();
            Assert.IsFalse(terms.HasNext());
        }
예제 #6
0
        public void SearchTermIteratorTestThreeFirstHit()
        {
            var terms = SearchTermIterator.GetInstance("one two three");

            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("one two three", terms.Next());
            terms.ReportHit();
            Assert.IsFalse(terms.HasNext());
        }
예제 #7
0
        public void ShrimpWhiteTest()
        {
            var terms = SearchTermIterator.GetInstance("shrimp white");

            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("shrimp white", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("shrimp", terms.Next());
            Assert.IsTrue(terms.HasNext());
            Assert.AreEqual("white", terms.Next());
            terms.ReportHit();
            Assert.IsFalse(terms.HasNext());
        }
예제 #8
0
        public void NullInputTest()
        {
            var terms = SearchTermIterator.GetInstance(null);

            Assert.IsFalse(terms.HasNext());
        }
예제 #9
0
        public void EmptyInputTest()
        {
            var terms = SearchTermIterator.GetInstance(string.Empty);

            Assert.IsFalse(terms.HasNext());
        }