public void TestAccept() { RedBlackTree <int, string> tree = GetTestTree(); TrackingVisitor <KeyValuePair <int, string> > visitor = new TrackingVisitor <KeyValuePair <int, string> >(); tree.Accept(visitor); Assert.AreEqual(visitor.TrackingList.Count, 100); for (int i = 0; i < 100; i++) { Assert.AreEqual(visitor.TrackingList.Contains(new KeyValuePair <int, string>(i, i.ToString())), true); } }
public void TestNullVisitor() { RedBlackTree <int, string> tree = GetTestTree(); tree.Accept(null); }