public void TestAccept() { PascalSet s = new PascalSet(0, 50, new int[] { 15, 20, 30, 40, 34 }); TrackingVisitor <int> v = new TrackingVisitor <int>(); s.Accept(v); Assert.AreEqual(v.TrackingList.Count, 5); Assert.AreEqual(v.TrackingList.Contains(15), true); Assert.AreEqual(v.TrackingList.Contains(20), true); Assert.AreEqual(v.TrackingList.Contains(30), true); Assert.AreEqual(v.TrackingList.Contains(40), true); Assert.AreEqual(v.TrackingList.Contains(34), true); }
public void TestNullVisitor() { PascalSet s1 = new PascalSet(10); s1.Accept(null); }