Beispiel #1
0
        public void CreateStringWithNoMatchingCharactersSecond()
        {
            var message    = "hruth is nowhere because it is miss spelled";
            var wordToFind = "truth";

            var bmhp   = new BoyerMooreHorspool(message);
            var result = bmhp.Found(wordToFind);

            Assert.IsFalse(result);
        }
Beispiel #2
0
        public void CreateStringWithMatchingCharactersAtEnd()
        {
            var message    = "we have found the truth";
            var wordToFind = "truth";

            var bmhp   = new BoyerMooreHorspool(message);
            var result = bmhp.Found(wordToFind);

            Assert.IsTrue(result);
        }
Beispiel #3
0
        public void CreateStringWithMatchingCharactersAtStart()
        {
            var message    = "truth is everywhere";
            var wordToFind = "truth";

            var bmhp   = new BoyerMooreHorspool(message);
            var result = bmhp.Found(wordToFind);

            Assert.IsTrue(result);
        }