示例#1
0
 [Test] public void Test_Main()
 {
     Trie t = new Trie();
     t["one"] = "two";
     Assert.AreEqual("two", t["one"]);
     Assert.AreEqual(t.Count, 1);
     t.Remove("one");
     Assert.AreEqual(t.Count, 0);
     Assert.AreEqual(null, t["one"]);
 }
示例#2
0
 [Test] public void Test_Clear()
 {
     Trie t = new Trie();
     Assert.AreEqual(t.Count, 0);
     t.Clear();
     Assert.AreEqual(t.Count, 0);
     t.Add("one", "one");
     Assert.AreEqual(t.Count, 1);
     t.Clear();
     Assert.AreEqual(t.Count, 0);
 }
示例#3
0
 private Trie data()
 {
     Trie t = new Trie();
     t.Add("one", "one");
     t[2]    = "2";
     t["~"]  = "~";
     t["a~"] = "a~";
     t["~a"] = "~a";
     t[' ']  = " ";
     t["  "] = "  ";
     Assert.AreEqual(t.Count, 7);
     Assert.IsTrue(t.Contains("~"));
     Assert.IsTrue(!t.Contains("~~"));
     return t;
 }
示例#4
0
 public TrieEnumerator(Trie t)
 {
     m_trie = t;
     m_pos.Push(m_trie.m_root);
 }
示例#5
0
 [Test] public void Test_Type()
 {
     Trie t = new Trie();
     Assert.AreEqual("kixeye.bedrock.collections.Trie", t.GetType().FullName);
 }