public void Simple() { var visitableList = ListTest.GetTestList(); var visitor = new SumVisitor(); visitableList.AcceptVisitor(visitor); Assert.AreEqual(visitor.Sum, 0 + 3 + 6 + 9 + 12); }
public void Simple() { var listBase = new ListBase <int>(); Assert.IsFalse(listBase.IsFixedSize); listBase = ListTest.GetTestList(); Assert.IsFalse(listBase.IsFixedSize); }
public void StoppingVisitor() { var visitableList = ListTest.GetTestList(); var visitor = new ComparableFindingVisitor <int>(6); visitableList.AcceptVisitor(visitor); Assert.IsTrue(visitor.Found); visitor = new ComparableFindingVisitor <int>(99); visitableList.AcceptVisitor(visitor); Assert.IsFalse(visitor.Found); }