Ejemplo n.º 1
0
        public static AdjacencyGraph CreateCyclicGraph(
            VertexAndEdgeProvider provider_iVertexAndEdgeProvider,
            bool allowParallelEdges_b,
            int numberOfVertices
            )
        {
            PexAssume.IsTrue(numberOfVertices < 50);

            AdjacencyGraph adjacencyGraph
                = new AdjacencyGraph(provider_iVertexAndEdgeProvider, allowParallelEdges_b);

            IVertex u = adjacencyGraph.AddVertex();
            IVertex v = adjacencyGraph.AddVertex();
            IVertex w = adjacencyGraph.AddVertex();

            adjacencyGraph.AddEdge(u, v);
            adjacencyGraph.AddEdge(v, w);
            adjacencyGraph.AddEdge(w, u);

            //Adding remaining number of vertices
            for (int count = 3; count < numberOfVertices; count++)
            {
                adjacencyGraph.AddVertex();
            }

            return(adjacencyGraph);
        }
Ejemplo n.º 2
0
        public static BidirectionalGraph CreateCyclicGraph(
            VertexAndEdgeProvider provider_iVertexAndEdgeProvider,
            bool allowParallelEdges_b,
            int numberOfVertices)
        {
            PexAssume.IsTrue(numberOfVertices < 50);

            BidirectionalGraph biGraph
                = new BidirectionalGraph(provider_iVertexAndEdgeProvider, allowParallelEdges_b);

            IVertex u = biGraph.AddVertex();
            IVertex v = biGraph.AddVertex();
            IVertex w = biGraph.AddVertex();

            biGraph.AddEdge(u, v);
            biGraph.AddEdge(v, w);
            biGraph.AddEdge(w, u);

            //Adding remaining number of vertices
            for (int count = 3; count < numberOfVertices; count++)
            {
                biGraph.AddVertex();
            }

            return(biGraph);
        }
Ejemplo n.º 3
0
        public void RemoveEdgeIf04()
        {
            BidirectionalGraph    bidirectionalGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            bidirectionalGraph = BidirectionalGraphFactory.CreateCyclicGraph(s0, false, 0);
            this.RemoveEdgeIf(bidirectionalGraph);
        }
        public void AddRemoveVertexNotFound05()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 0);
            this.AddRemoveVertexNotFound(adjacencyGraph);
        }
        public void AddEdgeTargetNotFound04()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, true, 9);
            this.AddEdgeTargetNotFound(adjacencyGraph);
        }
        public void AddEdgeTargetNotFound03()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, false, 4);
            this.AddEdgeTargetNotFound(adjacencyGraph);
        }
Ejemplo n.º 7
0
        public void RemoveEdgeNotFound07()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 16);
            ((GenericMutableGraphTestNEW)this).RemoveEdgeNotFound(adjacencyGraph);
        }
        public void GraphWithSelfEdgesPUT09()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, true, 16);
            this.GraphWithSelfEdgesPUT(adjacencyGraph, 2);
        }
        public void RemoveEdgeIf05()
        {
            BidirectionalGraph    bidirectionalGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            bidirectionalGraph = BidirectionalGraphFactory.CreateCyclicGraph(s0, false, 16);
            ((GenericMutableEdgeListGraphTest)this).RemoveEdgeIf(bidirectionalGraph);
        }
Ejemplo n.º 10
0
        public void RemoveEdgeNotFound06()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, true, 5);
            this.RemoveEdgeNotFound(adjacencyGraph);
        }
Ejemplo n.º 11
0
        public void RemoveEdgeNotFound08()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 16);
            this.RemoveEdgeNotFound(adjacencyGraph);
        }
Ejemplo n.º 12
0
        public void AddRemoveVertexNotFound05()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, true, 5);
            ((GenericMutableGraphTestNEW)this).AddRemoveVertexNotFound(adjacencyGraph);
        }
        public void AddEdgeTargetNotFound04()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, false, 5);
            ((GenericMutableGraphTestNEW)this).AddEdgeTargetNotFound(adjacencyGraph);
        }
        public void AddRemoveVertexNotFound04()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, true, 16);
            this.AddRemoveVertexNotFound(adjacencyGraph);
        }
        public void GraphWithSelfEdgesPUT08()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 0);
            this.GraphWithSelfEdgesPUT(adjacencyGraph, 2);
        }
Ejemplo n.º 16
0
        public void SortCyclicPUT_NEW08()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 16);
            this.SortCyclicPUT_NEW(adjacencyGraph, (IVertex[])null, false);
        }
Ejemplo n.º 17
0
        public void AddEdgeSourceNotFound03()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, true, 26);
            this.AddEdgeSourceNotFound(adjacencyGraph);
        }
Ejemplo n.º 18
0
        public void SortCyclicPUT_NEW20()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, true, 0);
            IVertex[] iVertexs = new IVertex[1];
            this.SortCyclicPUT_NEW(adjacencyGraph, iVertexs, false);
        }
Ejemplo n.º 19
0
        public void SortCyclicPUT_NEW18()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 16);
            IVertex[] iVertexs = new IVertex[3];
            this.SortCyclicPUT_NEW(adjacencyGraph, iVertexs, true);
        }
Ejemplo n.º 20
0
        public void GraphWithSelfEdgesPUT06()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 0);
            IPexChoiceRecorder choices = PexChoose.NewTest();

            this.GraphWithSelfEdgesPUT(adjacencyGraph, 2, false);
        }
Ejemplo n.º 21
0
        public void ClearVertexSourceTarget04()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 0);
            ((GenericMutableGraphTestNEW)this).ClearVertexSourceTarget(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }
        public void RemoveOutEdgeIf02()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 0);
            ((GenericMutableAdjacencyGraphTest)this).RemoveOutEdgeIf(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }
Ejemplo n.º 23
0
        public void IterationPUT03()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 0);
            this.IterationPUT(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }
Ejemplo n.º 24
0
        public void AddRemoveVertex02()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, false, 16);
            ((GenericMutableGraphTestNEW)this).AddRemoveVertex(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }
Ejemplo n.º 25
0
        public void TestOutDegree03()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 0);
            ((GenericAdjacencyGraphTest)this).TestOutDegree(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }
Ejemplo n.º 26
0
        public void ClearVertexTargetSource04()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph(s0, false, 0);
            this.ClearVertexTargetSource(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }
        public void AddRemoveVertex01()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, false, 0);
            this.AddRemoveVertex(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }
Ejemplo n.º 28
0
        public void IterationPUT02()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph(s0, false, 16);
            ((GenericVertexListGraphTest)this).IterationPUT(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }
        public void RemoveOutEdgeIf01()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateAcyclicGraph
                                 (s0, PexSafeHelpers.ByteToBoolean((byte)4), 49);
            ((GenericMutableAdjacencyGraphTest)this).RemoveOutEdgeIf(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }
Ejemplo n.º 30
0
        public void RemoveOutEdgeIf04()
        {
            AdjacencyGraph        adjacencyGraph;
            VertexAndEdgeProvider s0 = new VertexAndEdgeProvider();

            adjacencyGraph = AdjacencyGraphFactory.CreateCyclicGraph
                                 (s0, PexSafeHelpers.ByteToBoolean((byte)2), 16);
            this.RemoveOutEdgeIf(adjacencyGraph);
            PexAssert.IsNotNull((object)adjacencyGraph);
            PexAssert.AreEqual <bool>(true, adjacencyGraph.IsDirected);
            PexAssert.IsNotNull(adjacencyGraph.Provider);
            PexAssert.IsNotNull(adjacencyGraph.Edges);
        }