public void EmptyChDag_CreatorsNodesByGenerationReturnsEmpty() { Aleph.NodeCreator nodeCreator1 = new Aleph.NodeCreator(); Aleph.chDAG <object> aDAG = new Aleph.chDAG <object>(); Dictionary <int, HashSet <Aleph.IGraphNode <object> > > returnDict = aDAG.CreatorsNodesByGeneration(nodeCreator1); Assert.Empty(returnDict); }
public void ChDagWithChainByOneCreator_CreatorsNodesByGenerationReturnsCorrectly() { Aleph.NodeCreator nodeCreator1 = new Aleph.NodeCreator(); Aleph.RootNode <object> node0 = new Aleph.RootNode <object>(nodeCreator1, null); Aleph.GraphNode <object> node1 = new Aleph.GraphNode <object>(nodeCreator1, null, node0); Aleph.GraphNode <object> node2 = new Aleph.GraphNode <object>(nodeCreator1, null, node1); Aleph.chDAG <object> aDAG = new Aleph.chDAG <object> { node2 }; Dictionary <int, HashSet <Aleph.IGraphNode <object> > > returnDict = aDAG.CreatorsNodesByGeneration(nodeCreator1); Assert.NotEmpty(returnDict); Assert.True(returnDict.Keys.Count == 3); Assert.Contains(node0, returnDict[0]); Assert.Single(returnDict[0]); Assert.Contains(node1, returnDict[1]); Assert.Single(returnDict[1]); Assert.Contains(node2, returnDict[2]); Assert.Single(returnDict[2]); }