コード例 #1
0
        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);
            }
        }
コード例 #2
0
        public void TestNullVisitor()
        {
            RedBlackTree <int, string> tree = GetTestTree();

            tree.Accept(null);
        }