public void ShouldReturn1WithAbadAndA() { var result = BoyerMooreAlgorithm.MakeCharTable("abad"); Assert.AreEqual(1, result['a']); }
public void ShouldReturnIndex2Of4WithHoHo() { var result = BoyerMooreAlgorithm.MakeOffsetTable("HoHo"); Assert.AreEqual(4, result[2]); }
public void ShouldReturn6WithNeededAndPointerOf5() { var result = BoyerMooreAlgorithm.SuffixLength("needed", 5); Assert.AreEqual(6, result); }
public void ShouldReturn4WithAbcdAndE() { var result = BoyerMooreAlgorithm.MakeCharTable("abcd"); Assert.AreEqual(4, result['e']); }
public void ShouldReturnTrueWithHoHoAndPointerOf4() { var result = BoyerMooreAlgorithm.IsPrefix("HoHo", 4); Assert.IsTrue(result); }
public void ShouldReturn0WithTreeAndPointerOf4() { var result = BoyerMooreAlgorithm.SuffixLength("tree", 4); Assert.AreEqual(0, result); }
public void ShouldReturnFalseWithHoHoAndPointerOf3() { var result = BoyerMooreAlgorithm.IsPrefix("HoHo", 3); Assert.IsFalse(result); }
public void ShouldReturnIndex4Of9WithAbcde() { var result = BoyerMooreAlgorithm.MakeOffsetTable("Abcde"); Assert.AreEqual(9, result[4]); }
public void ShouldReturnIndex11Of9WithNeeded() { var result = BoyerMooreAlgorithm.MakeOffsetTable("Needed"); Assert.AreEqual(11, result[5]); }
public void ShouldReturnIndex3Of7WithTree() { var result = BoyerMooreAlgorithm.MakeOffsetTable("Tree"); Assert.AreEqual(7, result[3]); }
public void TestMethod1() { var result = BoyerMooreAlgorithm.GetIndex("This is a string describing farm life in the city of San Jose", "farm"); Assert.AreEqual(28, result); }