Exemplo n.º 1
0
        public void DisconnectNodeShouldRemoveEdge(ControlFlowEdgeType edgeType, bool removeSourceNode)
        {
            var graph = new ControlFlowGraph <int>(IntArchitecture.Instance);

            var n1 = new ControlFlowNode <int>(0, 0);
            var n2 = new ControlFlowNode <int>(1, 1);

            graph.Nodes.AddRange(new[]
            {
                n1,
                n2
            });

            n1.ConnectWith(n2, edgeType);

            if (removeSourceNode)
            {
                n1.Disconnect();
            }
            else
            {
                n2.Disconnect();
            }

            Assert.Empty(n1.GetOutgoingEdges());
            Assert.Empty(n2.GetIncomingEdges());
        }