Esempio n. 1
0
        public void TestAccept()
        {
            Deque <int> d = new Deque <int>();

            d.EnqueueHead(5);
            d.EnqueueHead(3);
            d.EnqueueHead(2);

            TrackingVisitor <int> visitor = new TrackingVisitor <int>();

            d.Accept(visitor);

            Assert.AreEqual(visitor.TrackingList.Count, 3);
            Assert.AreEqual(visitor.TrackingList.Contains(5), true);
            Assert.AreEqual(visitor.TrackingList.Contains(3), true);
            Assert.AreEqual(visitor.TrackingList.Contains(2), true);
        }
Esempio n. 2
0
        public void TestNullVisitor()
        {
            Deque <int> d = new Deque <int>();

            d.Accept(null);
        }