Ejemplo n.º 1
0
 public void Test_Clear()
 {
     Tree t = new Tree();
     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);
 }
Ejemplo n.º 2
0
 private Tree data()
 {
     Tree t = new Tree();
     t.Add("one", "one");
     t["2"] = "12";
     t["~"] = "2~";
     t["a~"] = "3a~";
     t["~a"] = "4~a";
     t[" "] = "5 ";
     t["  "] = "6  ";
     Assert.AreEqual(t.Count, 7);
     Assert.IsTrue(t.Contains("~"));
     Assert.IsTrue(!t.Contains("~~"));
     return t;
 }