public void PrefixTree_PartialMatch() { PrefixTree tree = new PrefixTree(); tree.Insert("PATRIK"); Assert.IsTrue(tree.IsPartialMatch("P")); Assert.IsTrue(tree.IsPartialMatch("PAT")); Assert.IsFalse(tree.IsPartialMatch("PAD")); Assert.IsFalse(tree.IsPartialMatch("T")); Assert.IsFalse(tree.IsPartialMatch("")); }
public void PrefixTree_PartialMatchWorksWithWrongCase() { PrefixTree tree = new PrefixTree(); tree.Insert("PATRIK"); Assert.IsTrue(tree.IsPartialMatch("p")); Assert.IsTrue(tree.IsPartialMatch("pat")); Assert.IsFalse(tree.IsPartialMatch("pad")); Assert.IsFalse(tree.IsPartialMatch("t")); }