Beispiel #1
0
		public void SimpleUsage()
		{
			GraphNode parent = new GraphNode();
			GraphNode child = new GraphNode();
			
			parent.AddDependent(child);

			Assert.AreSame( child, parent.Dependents[0] );
		}
		public void Removal()
		{
			GraphNode parent = new GraphNode();
			GraphNode child = new GraphNode();
			
			parent.AddDependent(child);
			
			child.RemoveDepender(parent);

			Assert.IsTrue( parent.Dependents.Length == 0 );
			Assert.IsTrue( parent.Dependers.Length == 0 );
			Assert.IsTrue( child.Dependers.Length == 0 );
			Assert.IsTrue( child.Dependents.Length == 0 );
		}