Esempio n. 1
0
        public void TestBruteForce2()
        {
            string t = "abcdefghijk";
            string p = "cde";

            Assert.That(StringMatcher.BruteForce2(t, p), Is.EqualTo(2));

            p = "abc";
            Assert.That(StringMatcher.BruteForce2(t, p), Is.EqualTo(0));

            p = "aabc";
            Assert.That(StringMatcher.BruteForce2(t, p), Is.LessThan(0));

            p = string.Empty;
            Assert.That(StringMatcher.BruteForce2(t, p), Is.EqualTo(0));

            t = "one";
            p = "bigger";
            Assert.That(StringMatcher.BruteForce2(t, p), Is.LessThan(0));
        }