Example #1
0
        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"));
            }
        }
Example #2
0
 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);
 }