public void TestReturnNumberOfFramesToPrecompute() { // create graph AnonymousNode node0 = new AnonymousNode() { Name = "node0" }; AnonymousNode node1 = new AnonymousNode() { Name = "node1" }; AnonymousNode node2 = new AnonymousNode(node0) { Name = "node2" }; AnonymousNode node3 = new AnonymousNode(node0, node1) { Name = "node3" }; AnonymousNode node4 = new AnonymousNode(node3) { Name = "node4" }; PipelineGraph graph = new PipelineGraph { Nodes = { node0, node1, node2, node3, node4 } }; //set number of frames to precompute in the graph's nodes node0.SettableNumberOfFramesToPrecompute = 0; node1.SettableNumberOfFramesToPrecompute = 1; node2.SettableNumberOfFramesToPrecompute = 2; node3.SettableNumberOfFramesToPrecompute = 4; node4.SettableNumberOfFramesToPrecompute = 8; List <AnonymousNode> nodeList = new List <AnonymousNode>(); nodeList.Add(node0); Assert.Equal(0, graph.NumberOfTicksToPrecompute(nodeList)); nodeList.Add(node1); Assert.Equal(1, graph.NumberOfTicksToPrecompute(nodeList)); nodeList.Add(node2); Assert.Equal(2, graph.NumberOfTicksToPrecompute(nodeList)); nodeList.Add(node3); Assert.Equal(5, graph.NumberOfTicksToPrecompute(nodeList)); nodeList.Add(node4); Assert.Equal(13, graph.NumberOfTicksToPrecompute(nodeList)); }