public void TestCanGetAllKeysWithAGivenPrefix() { TST<int> tst = new TST<int>(); string[] keys = testKeystwo.Split(' '); for (int i = 0; i < keys.Length; i++) { tst.Put(keys[i], i); } Assert.IsTrue(tst.PrefixMatch("se").Count() == 3); foreach (var key in tst.PrefixMatch("se")) { Assert.IsTrue(key.StartsWith("se")); } }
public void TestPrefixMatchThrowsNullException() { TST<int> tst = new TST<int>(); string[] keys = testKeystwo.Split(' '); for (int i = 0; i < keys.Length; i++) { tst.Put(keys[i], i); } tst.PrefixMatch(null); }