예제 #1
0
        public void Connects_GetDirectedEdges_EdgesWithoutArrowsAreExcluded_withArrowHeads1()
        {
            var page1  = GetNewPage();
            var shapes = draw_standard_shapes(page1);

            connect(shapes[0], shapes[1], true, false);
            connect(shapes[1], shapes[2], true, false);

            var edges1 = VACXN.PathAnalysis.GetDirectedEdges(page1, VACXN.ConnectorEdgeHandling.Arrow_ExcludeConnectorsWithoutArrows);
            var map1   = new ConnectivityMap(edges1);

            Assert.AreEqual(2, map1.CountFromNodes());
            Assert.IsTrue(map1.HasConnectionFromTo("B", "A"));
            Assert.IsTrue(map1.HasConnectionFromTo("C", "B"));
            Assert.AreEqual(1, map1.CountConnectionsFrom("B"));
            Assert.AreEqual(1, map1.CountConnectionsFrom("C"));


            var edges2 = VACXN.PathAnalysis.GetTransitiveClosure(page1, VACXN.ConnectorEdgeHandling.Arrow_TreatConnectorsWithoutArrowsAsBidirectional);
            var map2   = new ConnectivityMap(edges1);

            Assert.AreEqual(2, map2.CountFromNodes());
            Assert.IsTrue(map2.HasConnectionFromTo("B", "A"));
            Assert.IsTrue(map2.HasConnectionFromTo("C", "B"));
            Assert.AreEqual(1, map2.CountConnectionsFrom("B"));
            Assert.AreEqual(1, map2.CountConnectionsFrom("C"));


            page1.Delete(0);
        }
예제 #2
0
        public void PathAnalysis_GetDirectEdgesRaw()
        {
            var page1  = GetNewPage();
            var shapes = draw_standard_shapes(page1);

            connect(shapes[0], shapes[1], false, false);
            connect(shapes[1], shapes[2], false, false);

            var edges = VACXN.PathAnalysis.GetDirectedEdges(page1, VACXN.ConnectorEdgeHandling.Raw);
            var map   = new ConnectivityMap(edges);

            Assert.AreEqual(2, map.CountFromNodes());
            Assert.IsTrue(map.HasConnectionFromTo("A", "B"));
            Assert.IsTrue(map.HasConnectionFromTo("B", "C"));
            Assert.AreEqual(1, map.CountConnectionsFrom("A"));
            Assert.AreEqual(1, map.CountConnectionsFrom("B"));
            page1.Delete(0);
        }
예제 #3
0
        public void Connects_GetDirectedEdges_EdgesWithoutArrowsAreExcluded()
        {
            var page1  = GetNewPage();
            var shapes = draw_standard_shapes(page1);

            connect(shapes[0], shapes[1], false, false);
            connect(shapes[1], shapes[2], false, false);

            var edges1 = VACXN.PathAnalysis.GetDirectedEdges(page1, VACXN.ConnectorEdgeHandling.Arrow_ExcludeConnectorsWithoutArrows);
            var map1   = new ConnectivityMap(edges1);

            Assert.AreEqual(0, map1.CountFromNodes());

            var edges2 = VACXN.PathAnalysis.GetTransitiveClosure(page1, VACXN.ConnectorEdgeHandling.Arrow_ExcludeConnectorsWithoutArrows);
            var map2   = new ConnectivityMap(edges2);

            Assert.AreEqual(0, map2.CountFromNodes());

            page1.Delete(0);
        }