Beispiel #1
0
        public void TestAccept()
        {
            BinaryTree <int>      t = GetTestTree();
            TrackingVisitor <int> v = new TrackingVisitor <int>();

            t.Accept(v);

            Assert.AreEqual(v.TrackingList.Count, 6);

            Assert.AreEqual(v.TrackingList.Contains(5), true);
            Assert.AreEqual(v.TrackingList.Contains(2), true);
            Assert.AreEqual(v.TrackingList.Contains(3), true);
            Assert.AreEqual(v.TrackingList.Contains(9), true);
            Assert.AreEqual(v.TrackingList.Contains(12), true);
            Assert.AreEqual(v.TrackingList.Contains(13), true);
        }
Beispiel #2
0
        public void TestNullVisitor()
        {
            BinaryTree <int> t = GetTestTree();

            t.Accept(null);
        }