public void AddAndRemoveOnEmptyGraph() { this.target = new ReversedEdgeAugmentorAlgorithm(new AdjacencyGraph()); target.AddReversedEdges(); Assert.AreEqual(0, this.target.VisitedGraph.VerticesCount); Assert.AreEqual(0, this.target.VisitedGraph.EdgesCount); }
public void AddAndRemoveAndCheckAugmented() { this.target = new ReversedEdgeAugmentorAlgorithm(new AdjacencyGraph()); Assert.IsFalse(target.Augmented); target.AddReversedEdges(); Assert.IsTrue(target.Augmented); target.RemoveReversedEdges(); Assert.IsFalse(target.Augmented); }
public void AddAndRemoveOneEdge() { AdjacencyGraph g = new AdjacencyGraph(); IVertex v = g.AddVertex(); IVertex u = g.AddVertex(); IEdge edge = g.AddEdge(u, v); this.target = new ReversedEdgeAugmentorAlgorithm(g); target.AddReversedEdges(); target.RemoveReversedEdges(); Assert.AreEqual(2, this.target.VisitedGraph.VerticesCount); Assert.AreEqual(1, this.target.VisitedGraph.EdgesCount); CollectionAssert.AreCountEqual(0, this.target.AugmentedEdges); Assert.AreEqual(0, this.target.ReversedEdges.Count); }
public void AddOneEdge() { AdjacencyGraph g = new AdjacencyGraph(); IVertex v = g.AddVertex(); IVertex u = g.AddVertex(); IEdge edge = g.AddEdge(u, v); this.target = new ReversedEdgeAugmentorAlgorithm(g); target.AddReversedEdges(); Assert.AreEqual(2, this.target.VisitedGraph.VerticesCount); Assert.AreEqual(2, this.target.VisitedGraph.EdgesCount); CollectionAssert.AreCountEqual(1, this.target.AugmentedEdges); VerifyReversedEdges(); IEdge reversedEdge = this.target.ReversedEdges[edge]; Assert.IsNotNull(reversedEdge); Assert.IsTrue(this.target.AugmentedEdges.Contains(reversedEdge)); }