Esempio n. 1
0
        public void CanInsertBlockNodeToContext()
        {
            GraphData graph = new GraphData();

            graph.AddContexts();

            var nodeA = new BlockNode();

            nodeA.Init(s_DescriptorA);
            graph.AddBlock(nodeA, graph.fragmentContext, 0);

            var nodeB = new BlockNode();

            nodeB.Init(s_DescriptorA);
            graph.AddBlock(nodeB, graph.fragmentContext, 0);

            Assert.AreEqual(0, graph.edges.Count());
            Assert.AreEqual(2, graph.GetNodes <BlockNode>().Count());
            Assert.AreEqual(2, graph.fragmentContext.blocks.Count());
            Assert.AreEqual(nodeB, graph.fragmentContext.blocks[0].value);
        }
Esempio n. 2
0
        public void CanGetBlockIndex()
        {
            GraphData graph = new GraphData();

            graph.AddContexts();

            var node = new BlockNode();

            node.Init(s_DescriptorA);
            graph.AddBlock(node, graph.fragmentContext, 0);

            Assert.AreEqual(0, node.index);
        }
Esempio n. 3
0
        public void CanAddBlockNodeToContext()
        {
            GraphData graph = new GraphData();

            graph.AddContexts();

            var node = new BlockNode();

            node.Init(s_DescriptorA);
            graph.AddBlock(node, graph.fragmentContext, 0);

            Assert.AreEqual(0, graph.edges.Count());
            Assert.AreEqual(1, graph.GetNodes <BlockNode>().Count());
            Assert.AreEqual(1, graph.fragmentContext.blocks.Count());
        }