public void Test_12_CountingVisitorOnC1() { DataStructures.GenericNode <string> root = new DataStructures.GenericNode <string>(); GenericNodeTestData.AddTestChildren(root); root = root.FindDescNode("C1"); this._AssertCountingVisitor(root, DataStructures.VisitationType.None, 0); this._AssertCountingVisitor(root, DataStructures.VisitationType.Parents, 3); this._AssertCountingVisitor(root, DataStructures.VisitationType.PreviousSiblings, 0); this._AssertCountingVisitor(root, DataStructures.VisitationType.NextSiblings, 2); this._AssertCountingVisitor(root, DataStructures.VisitationType.PreviousNodes, 3); this._AssertCountingVisitor(root, DataStructures.VisitationType.NextNodes, 11); this._AssertCountingVisitor(root, DataStructures.VisitationType.Children, 3); // Not Implemented: this._AssertCountingVisitor( root, DataStructures.VisitationType.DecendentsBreadthFirst, 0 ); this._AssertCountingVisitor(root, DataStructures.VisitationType.DecendentsDepthFirst, 3); return; }
public void Test_22_TripleSynchronize() { // Create the source root node. DataStructures.StringNode root = new DataStructures.StringNode(); // Create the synchronized root nodes. DataStructures.SynchronizedStringNode snode1 = new DataStructures.SynchronizedStringNode(root); DataStructures.SynchronizedStringNode snode2 = new DataStructures.SynchronizedStringNode(root); DataStructures.SynchronizedStringNode snode3 = new DataStructures.SynchronizedStringNode(root); // Create a notification broadcaster to push notifications to all synchronized nodes. DataStructures.StringNode.NodeNotificationBroadcaster broadcaster = new DataStructures.StringNode.NodeNotificationBroadcaster(); broadcaster.Listeners.Add(snode1); broadcaster.Listeners.Add(snode2); broadcaster.Listeners.Add(snode3); root.Listener = broadcaster; // Modify the source root node. GenericNodeTestData.AddTestChildren(root); // Validate the synchronized nodes. GenericNodeTestData.AssertTestChildren(root); GenericNodeTestData.AssertTestChildren(snode1); GenericNodeTestData.AssertTestChildren(snode2); GenericNodeTestData.AssertTestChildren(snode3); // Return, OK. return; }