From f4d52ad352bb6fac7c7af44d014ae53ecaff665d Mon Sep 17 00:00:00 2001
From: Spoc Web <10584012+SpocWeb@users.noreply.github.com>
Date: Sat, 3 Aug 2024 11:52:23 +0200
Subject: [PATCH 001/115] added Comments
---
src/QuikGraph.Graphviz/FileDotEngine.cs | 2 +-
src/QuikGraph.Graphviz/Interfaces/IDotEngine.cs | 5 ++---
.../Renderers/GraphRendererBase.cs | 4 ----
src/QuikGraph/Extensions/GraphExtensions.cs | 13 +++++++------
4 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/src/QuikGraph.Graphviz/FileDotEngine.cs b/src/QuikGraph.Graphviz/FileDotEngine.cs
index dfef0927b..f7c909b6e 100644
--- a/src/QuikGraph.Graphviz/FileDotEngine.cs
+++ b/src/QuikGraph.Graphviz/FileDotEngine.cs
@@ -5,7 +5,7 @@
namespace QuikGraph.Graphviz
{
///
- /// Default dot engine implementation, writes dot code to disk.
+ /// Default dot engine implementation, writes 'dot'-formatted code to disk.
///
public sealed class FileDotEngine : IDotEngine
{
diff --git a/src/QuikGraph.Graphviz/Interfaces/IDotEngine.cs b/src/QuikGraph.Graphviz/Interfaces/IDotEngine.cs
index 7a6355037..d20fe5d26 100644
--- a/src/QuikGraph.Graphviz/Interfaces/IDotEngine.cs
+++ b/src/QuikGraph.Graphviz/Interfaces/IDotEngine.cs
@@ -3,9 +3,7 @@
namespace QuikGraph.Graphviz
{
- ///
- /// Represents a Dot engine runner.
- ///
+ /// Represents a Dot engine runner.
public interface IDotEngine
{
///
@@ -18,6 +16,7 @@ public interface IDotEngine
/// Path to the saved result.
/// is or empty.
/// is or empty.
+ /// the possibly fixed with an extension.
[NotNull]
string Run(
GraphvizImageType imageType,
diff --git a/src/QuikGraph.Graphviz/Renderers/GraphRendererBase.cs b/src/QuikGraph.Graphviz/Renderers/GraphRendererBase.cs
index ad4ffc324..ce5d731e4 100644
--- a/src/QuikGraph.Graphviz/Renderers/GraphRendererBase.cs
+++ b/src/QuikGraph.Graphviz/Renderers/GraphRendererBase.cs
@@ -65,15 +65,11 @@ public string Generate([NotNull] IDotEngine dot, [NotNull] string outputFilePath
return Graphviz.Generate(dot, outputFilePath);
}
- #region Local function
-
IDisposable GenerationScope()
{
Initialize();
return DisposableHelpers.Finally(Clean);
}
-
- #endregion
}
}
}
\ No newline at end of file
diff --git a/src/QuikGraph/Extensions/GraphExtensions.cs b/src/QuikGraph/Extensions/GraphExtensions.cs
index 8f8a50096..725ea3405 100644
--- a/src/QuikGraph/Extensions/GraphExtensions.cs
+++ b/src/QuikGraph/Extensions/GraphExtensions.cs
@@ -5,9 +5,7 @@
namespace QuikGraph
{
- ///
- /// Extensions for populating graph data structures.
- ///
+ /// Extensions for populating graph data structures.
public static class GraphExtensions
{
#region Delegate graphs
@@ -59,7 +57,8 @@ public static DelegateIncidenceGraph ToDelegateIncidenceGraph is .
[Pure]
[NotNull]
- public static DelegateVertexAndEdgeListGraph ToDelegateVertexAndEdgeListGraph(
+ public static DelegateVertexAndEdgeListGraph ToDelegateVertexAndEdgeListGraph(
[NotNull] this IDictionary dictionary)
where TEdge : IEdge
where TEdges : IEnumerable
@@ -80,7 +79,8 @@ public static DelegateVertexAndEdgeListGraph ToDelegateVertexAnd
/// is .
[Pure]
[NotNull]
- public static DelegateVertexAndEdgeListGraph ToDelegateVertexAndEdgeListGraph(
+ public static DelegateVertexAndEdgeListGraph ToDelegateVertexAndEdgeListGraph(
[NotNull] this IDictionary dictionary,
#if SUPPORTS_CONVERTER
[NotNull] Converter, IEnumerable> keyValueToOutEdges)
@@ -166,7 +166,8 @@ public static DelegateVertexAndEdgeListGraph ToDelegateVertexAnd
/// is .
[Pure]
[NotNull]
- public static DelegateBidirectionalIncidenceGraph ToDelegateBidirectionalIncidenceGraph(
+ public static DelegateBidirectionalIncidenceGraph ToDelegateBidirectionalIncidenceGraph(
[NotNull] this TryFunc> tryGetOutEdges,
[NotNull] TryFunc> tryGetInEdges)
where TEdge : IEdge
From e6ba4c9502a24560f79e1a5b60fcdce91f88d04e Mon Sep 17 00:00:00 2001
From: Spoc Web <10584012+SpocWeb@users.noreply.github.com>
Date: Sun, 4 Aug 2024 16:19:25 +0200
Subject: [PATCH 002/115] Factory Method Edge.Create
---
.../Events/MsaglEdgeEventArgs.cs | 5 +-
.../MsaglDefaultGraphPopulator.cs | 2 +-
src/QuikGraph.MSAGL/MsaglGraphPopulator.cs | 4 +-
.../MsaglIdentifiableGraphPopulator.cs | 2 +-
.../CondensationGraphAlgorithm.cs | 2 +-
.../Algorithms/Condensation/CondensedEdge.cs | 5 +-
.../EdgeMergeCondensationGraphAlgorithm.cs | 2 +-
src/QuikGraph/Structures/Edges/Edge.cs | 11 +
.../Extensions/GraphvizExtensionsTests.cs | 52 +--
.../GraphvizAlgorithmTests.cs | 94 ++--
.../CondensatedGraphRendererTests.cs | 42 +-
.../EdgeMergeCondensatedGraphRendererTests.cs | 22 +-
.../Events/MsaglEdgeEventArgsTests.cs | 10 +-
.../MsaglGraphExtensionsTests.cs | 20 +-
.../MsaglGraphPopulatorTestsBase.cs | 38 +-
.../MsaglIdentifiableGraphPopulatorTests.cs | 4 +-
.../MsaglToStringGraphPopulatorTests.cs | 4 +-
.../XmlSerializableStructuresTests.cs | 16 +-
.../Cliques/MaximumCliqueAlgorithmTests.cs | 6 +-
.../CondensationGraphAlgorithmTestsBase.cs | 5 +-
.../Condensation/CondensededEdgeTests.cs | 10 +-
...dgeMergeCondensationGraphAlgorithmTests.cs | 55 ++-
.../Condensation/MergedEdgeTests.cs | 8 +-
...onnectedCondensationGraphAlgorithmTests.cs | 38 +-
...onnectedCondensationGraphAlgorithmTests.cs | 42 +-
.../ConnectedComponentsAlgorithmTests.cs | 46 +-
...mentalConnectedComponentsAlgorithmTests.cs | 14 +-
...ronglyConnectedComponentsAlgorithmTests.cs | 44 +-
...WeaklyConnectedComponentsAlgorithmTests.cs | 46 +-
.../DistancesCollectionContractBase.cs | 20 +-
.../DistancesCollectionGetDistanceContract.cs | 8 +-
...DistancesCollectionGetDistancesContract.cs | 4 +-
...stancesCollectionTryGetDistanceContract.cs | 8 +-
.../Contracts/VertexColorizerContract.cs | 8 +-
.../Algorithms/EulerianTrailAlgorithmTests.cs | 84 ++--
.../MaximumBipartiteMatchingAlgorithmTests.cs | 4 +-
...AllVerticesGraphAugmentorAlgorithmTests.cs | 12 +-
...MaximumFlowGraphAugmentorAlgorithmTests.cs | 14 +-
.../EdmondsKarpMaximumFlowAlgorithmTests.cs | 8 +-
.../GraphBalancerAlgorithmTests.cs | 22 +-
...iSourceSinkGraphAugmentorAlgorithmTests.cs | 12 +-
.../ReversedEdgeAugmentorAlgorithmTests.cs | 30 +-
.../MinimumSpanningTreeTestsBase.cs | 8 +-
.../EdgePredecessorRecorderObserverTests.cs | 160 +++----
.../Observers/EdgeRecorderObserverTests.cs | 22 +-
...ctedVertexDistanceRecorderObserverTests.cs | 12 +-
...dVertexPredecessorRecorderObserverTests.cs | 26 +-
.../VertexDistanceRecorderObserverTests.cs | 30 +-
...texPredecessorPathRecorderObserverTests.cs | 62 +--
.../VertexPredecessorRecorderObserverTests.cs | 62 +--
.../Observers/VertexRecorderObserverTests.cs | 6 +-
.../VertexTimeStamperObserverTests.cs | 6 +-
.../Algorithms/RandomGraphFactoryTests.cs | 60 +--
.../CyclePoppingRandomTreeAlgorithmTests.cs | 18 +-
.../RandomWalks/RandomWalkAlgorithmTests.cs | 12 +-
...nPavleyRankedShortestPathAlgorithmTests.cs | 2 +-
.../BestFirstFrontierSearchAlgorithmTests.cs | 12 +-
...rectionalDepthFirstSearchAlgorithmTests.cs | 20 +-
.../Search/BreadthFirstSearchAlgirthmTests.cs | 2 +-
.../Search/DepthFirstSearchAlgorithmTests.cs | 20 +-
.../EdgeDepthFirstSearchAlgorithmTests.cs | 18 +-
...directedBreathFirstSearchAlgorithmTests.cs | 2 +-
...ndirectedDepthFirstSearchAlgorithmTests.cs | 20 +-
.../AStarShortestPathAlgorithmTests.cs | 28 +-
.../BellmanFordShortestPathAlgorithmTests.cs | 10 +-
.../DagShortestPathAlgorithmTests.cs | 2 +-
.../DijkstraShortestPathAlgorithmTests.cs | 28 +-
...ydWarshallAllShortestPathAlgorithmTests.cs | 14 +-
...ectedDijkstraShortestPathAlgorithmTests.cs | 2 +-
...irectionalTopologicalSortAlgorithmTests.cs | 60 +--
...ourceFirstTopologicalSortAlgorithmTests.cs | 60 +--
.../TopologicalSortAlgorithmTests.cs | 54 +--
...ectedFirstTopologicalSortAlgorithmTests.cs | 52 +--
...UndirectedTopologicalSortAlgorithmTests.cs | 52 +--
.../TransitiveClosureAlgorithmTests.cs | 4 +-
.../TransitiveReductionAlgorithmTests.cs | 32 +-
...mVertexCoverApproximationAlgorithmTests.cs | 14 +-
.../Events/EdgeEventArgsTests.cs | 2 +-
.../Events/UndirectedEdgeEventArgsTests.cs | 2 +-
.../Extensions/AlgorithmExtensionsTests.cs | 418 +++++++++---------
.../Extensions/EdgeExtensionsTests.cs | 130 +++---
.../Extensions/GraphExtensionsTests.cs | 100 ++---
.../Graphs/EquatableGraphTests.cs | 30 +-
.../GraphTestsBases/FilteredGraphTestsBase.cs | 302 ++++++-------
.../IsolatedVertexPredicateTests.cs | 6 +-
.../Predicates/ResidualEdgePredicateTests.cs | 8 +-
.../ReversedResidualEdgePredicateTests.cs | 12 +-
.../Predicates/SinkVertexTests.cs | 6 +-
.../Structures/Edges/EdgeTests.cs | 16 +-
.../Structures/Edges/SReversedEdgeTests.cs | 22 +-
.../Structures/Graphs/AdjacencyGraphTests.cs | 28 +-
.../Graphs/ArrayAdjacencyGraphTests.cs | 14 +-
.../Graphs/ArrayBidirectionalGraphTests.cs | 14 +-
.../Graphs/ArrayUndirectedGraphTests.cs | 14 +-
.../Graphs/BidirectionalGraphAdapterTests.cs | 20 +-
.../Graphs/BidirectionalGraphTests.cs | 60 +--
.../Graphs/BidirectionalMatrixGraphTests.cs | 58 +--
.../Graphs/ClusteredAdjacencyGraphTests.cs | 16 +-
.../Graphs/CompressedSparseRowGraphTests.cs | 20 +-
.../Graphs/DelegateUndirectedGraphTests.cs | 50 +--
.../DelegateVertexAndEdgeListGraphTests.cs | 50 +--
.../Structures/Graphs/EdgeListGraphTests.cs | 12 +-
.../GraphTestsBases/DelegateGraphTestsBase.cs | 110 ++---
.../GraphTestsBase.AddEdges.cs | 118 ++---
.../GraphTestsBase.AddVerticesAndEdge.cs | 42 +-
.../GraphTestsBase.AdjacentEdges.cs | 52 +--
.../GraphTestsBase.ContainsEdge.cs | 126 +++---
.../GraphTestsBases/GraphTestsBase.Degree.cs | 48 +-
.../GraphTestsBases/GraphTestsBase.InEdges.cs | 92 ++--
.../GraphTestsBase.OutEdges.cs | 130 +++---
.../GraphTestsBase.RemoveEdges.cs | 210 ++++-----
.../GraphTestsBase.RemoveVertices.cs | 72 +--
.../GraphTestsBase.TryGetEdges.cs | 266 +++++------
.../Graphs/ReversedBidirectionalGraphTests.cs | 2 +-
.../Structures/Graphs/UndirectedGraphTests.cs | 68 +--
115 files changed, 2306 insertions(+), 2315 deletions(-)
diff --git a/src/QuikGraph.MSAGL/Events/MsaglEdgeEventArgs.cs b/src/QuikGraph.MSAGL/Events/MsaglEdgeEventArgs.cs
index d0f658545..f14377357 100644
--- a/src/QuikGraph.MSAGL/Events/MsaglEdgeEventArgs.cs
+++ b/src/QuikGraph.MSAGL/Events/MsaglEdgeEventArgs.cs
@@ -1,6 +1,5 @@
using System;
using JetBrains.Annotations;
-using Microsoft.Msagl.Drawing;
namespace QuikGraph.MSAGL
{
@@ -20,7 +19,7 @@ public class MsaglEdgeEventArgs : EdgeEventArgs
/// Concerned .
/// is .
/// is .
- public MsaglEdgeEventArgs([NotNull] TEdge edge, [NotNull] Edge msaglEdge)
+ public MsaglEdgeEventArgs([NotNull] TEdge edge, [NotNull] Microsoft.Msagl.Drawing.Edge msaglEdge)
: base(edge)
{
MsaglEdge = msaglEdge ?? throw new ArgumentNullException(nameof(msaglEdge));
@@ -30,6 +29,6 @@ public MsaglEdgeEventArgs([NotNull] TEdge edge, [NotNull] Edge msaglEdge)
/// concerned by the event.
///
[NotNull]
- public Edge MsaglEdge { get; }
+ public Microsoft.Msagl.Drawing.Edge MsaglEdge { get; }
}
}
\ No newline at end of file
diff --git a/src/QuikGraph.MSAGL/MsaglDefaultGraphPopulator.cs b/src/QuikGraph.MSAGL/MsaglDefaultGraphPopulator.cs
index e9d60c2d8..1eed453dc 100644
--- a/src/QuikGraph.MSAGL/MsaglDefaultGraphPopulator.cs
+++ b/src/QuikGraph.MSAGL/MsaglDefaultGraphPopulator.cs
@@ -82,7 +82,7 @@ protected virtual string GetVertexLabel([NotNull] string id, [NotNull] TVertex v
}
///
- protected override Edge AddEdge(TEdge edge)
+ protected override Microsoft.Msagl.Drawing.Edge AddEdge(TEdge edge)
{
if (edge == null)
throw new ArgumentNullException(nameof(edge));
diff --git a/src/QuikGraph.MSAGL/MsaglGraphPopulator.cs b/src/QuikGraph.MSAGL/MsaglGraphPopulator.cs
index 058a020d0..473a6ad6c 100644
--- a/src/QuikGraph.MSAGL/MsaglGraphPopulator.cs
+++ b/src/QuikGraph.MSAGL/MsaglGraphPopulator.cs
@@ -83,7 +83,7 @@ protected override void InternalCompute()
foreach (TEdge edge in VisitedGraph.Edges)
{
- Edge msaglEdge = AddEdge(edge);
+ Microsoft.Msagl.Drawing.Edge msaglEdge = AddEdge(edge);
msaglEdge.UserData = edge;
OnEdgeAdded(new MsaglEdgeEventArgs(edge, msaglEdge));
}
@@ -105,6 +105,6 @@ protected override void InternalCompute()
/// Edge to add.
/// Added .
/// is .
- protected abstract Edge AddEdge([NotNull] TEdge edge);
+ protected abstract Microsoft.Msagl.Drawing.Edge AddEdge([NotNull] TEdge edge);
}
}
\ No newline at end of file
diff --git a/src/QuikGraph.MSAGL/MsaglIdentifiableGraphPopulator.cs b/src/QuikGraph.MSAGL/MsaglIdentifiableGraphPopulator.cs
index 01092da9e..35fcee253 100644
--- a/src/QuikGraph.MSAGL/MsaglIdentifiableGraphPopulator.cs
+++ b/src/QuikGraph.MSAGL/MsaglIdentifiableGraphPopulator.cs
@@ -37,7 +37,7 @@ protected override Node AddNode(TVertex vertex)
}
///
- protected override Edge AddEdge(TEdge edge)
+ protected override Microsoft.Msagl.Drawing.Edge AddEdge(TEdge edge)
{
return MsaglGraph.AddEdge(
_vertexIdentity(edge.Source),
diff --git a/src/QuikGraph/Algorithms/Condensation/CondensationGraphAlgorithm.cs b/src/QuikGraph/Algorithms/Condensation/CondensationGraphAlgorithm.cs
index b781ca7c1..be768436f 100644
--- a/src/QuikGraph/Algorithms/Condensation/CondensationGraphAlgorithm.cs
+++ b/src/QuikGraph/Algorithms/Condensation/CondensationGraphAlgorithm.cs
@@ -6,7 +6,7 @@
namespace QuikGraph.Algorithms.Condensation
{
///
- /// Algorithm that condensate a graph with strongly (or not) components.
+ /// Algorithm that condensate a graph with strongly (or not) connected components.
///
/// Vertex type.
/// Edge type.
diff --git a/src/QuikGraph/Algorithms/Condensation/CondensedEdge.cs b/src/QuikGraph/Algorithms/Condensation/CondensedEdge.cs
index e1db4f687..d75ed3bc7 100644
--- a/src/QuikGraph/Algorithms/Condensation/CondensedEdge.cs
+++ b/src/QuikGraph/Algorithms/Condensation/CondensedEdge.cs
@@ -6,12 +6,11 @@
namespace QuikGraph.Algorithms.Condensation
{
- ///
- /// An edge connecting two graphs.
- ///
+ /// An edge connecting two graphs(!), not Vertices.
/// Vertex type.
/// Edge type.
/// Graph type.
+ /// Used in
#if SUPPORTS_SERIALIZATION
[Serializable]
#endif
diff --git a/src/QuikGraph/Algorithms/Condensation/EdgeMergeCondensationGraphAlgorithm.cs b/src/QuikGraph/Algorithms/Condensation/EdgeMergeCondensationGraphAlgorithm.cs
index d1a407706..537406adf 100644
--- a/src/QuikGraph/Algorithms/Condensation/EdgeMergeCondensationGraphAlgorithm.cs
+++ b/src/QuikGraph/Algorithms/Condensation/EdgeMergeCondensationGraphAlgorithm.cs
@@ -17,7 +17,7 @@ public sealed class EdgeMergeCondensationGraphAlgorithm : Algori
/// Initializes a new instance of the class.
///
/// Graph to visit.
- /// Graph that will contains the condensation of the .
+ /// Graph that will contain the condensation of the .
/// Vertex predicate used to filter the vertices to put in the condensed graph.
/// is .
/// is .
diff --git a/src/QuikGraph/Structures/Edges/Edge.cs b/src/QuikGraph/Structures/Edges/Edge.cs
index c5cd56030..246ef2aad 100644
--- a/src/QuikGraph/Structures/Edges/Edge.cs
+++ b/src/QuikGraph/Structures/Edges/Edge.cs
@@ -5,6 +5,17 @@
namespace QuikGraph
{
+ ///
+ public static class Edge
+ {
+ /// Creates a new from to
+ ///
+ /// A Factory Method allows to centrally change the Types of Edges to create.
+ /// It can also be registered with an IoC Container to dynamically create new Edges.
+ ///
+ public static Edge Create(TVertex source, TVertex target) => new Edge(source, target);
+ }
+
///
/// The default implementation (directed edge).
///
diff --git a/tests/QuikGraph.Graphviz.Tests/Extensions/GraphvizExtensionsTests.cs b/tests/QuikGraph.Graphviz.Tests/Extensions/GraphvizExtensionsTests.cs
index b7a0367d8..cf72508ab 100644
--- a/tests/QuikGraph.Graphviz.Tests/Extensions/GraphvizExtensionsTests.cs
+++ b/tests/QuikGraph.Graphviz.Tests/Extensions/GraphvizExtensionsTests.cs
@@ -21,9 +21,9 @@ public void ToGraphviz()
var graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 1)
});
graph.AddVertexRange(new[] { 4, 5 });
@@ -52,13 +52,13 @@ public void ToGraphviz_DelegateGraph()
{
if (vertex == 1)
{
- outEdges = new[] { new Edge(1, 2), new Edge(1, 3) };
+ outEdges = new[] { Edge.Create(1, 2), Edge.Create(1, 3) };
return true;
}
if (vertex == 2)
{
- outEdges = new[] { new Edge(2, 4) };
+ outEdges = new[] { Edge.Create(2, 4) };
return true;
}
@@ -138,9 +138,9 @@ public void ToGraphvizWithEmptyInit()
var graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 1)
});
graph.AddVertexRange(new[] { 4, 5 });
@@ -176,20 +176,20 @@ public void ToGraphvizWithInit()
var wrappedGraph = new AdjacencyGraph>();
wrappedGraph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(1, 3),
- new Edge(2, 4)
+ Edge.Create(1, 2),
+ Edge.Create(1, 3),
+ Edge.Create(2, 4)
});
wrappedGraph.AddVertex(5);
var clusteredGraph = new ClusteredAdjacencyGraph>(wrappedGraph);
ClusteredAdjacencyGraph> subGraph1 = clusteredGraph.AddCluster();
subGraph1.AddVerticesAndEdgeRange(new[]
{
- new Edge(6, 7),
- new Edge(7, 8)
+ Edge.Create(6, 7),
+ Edge.Create(7, 8)
});
ClusteredAdjacencyGraph> subGraph2 = clusteredGraph.AddCluster();
- subGraph2.AddVerticesAndEdge(new Edge(9, 10));
+ subGraph2.AddVerticesAndEdge(Edge.Create(9, 10));
subGraph2.AddVertex(11);
string expectedDot =
@@ -236,9 +236,9 @@ public void ToGraphvizWithInit2()
var graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(1, 3),
- new Edge(2, 4)
+ Edge.Create(1, 2),
+ Edge.Create(1, 3),
+ Edge.Create(2, 4)
});
graph.AddVertex(5);
@@ -277,9 +277,9 @@ public void ToGraphvizWithInit_Record()
var graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(1, 3),
- new Edge(2, 4)
+ Edge.Create(1, 2),
+ Edge.Create(1, 3),
+ Edge.Create(2, 4)
});
graph.AddVertex(5);
@@ -336,9 +336,9 @@ public void ToGraphvizWithInit_Record2()
var graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(1, 3),
- new Edge(2, 4)
+ Edge.Create(1, 2),
+ Edge.Create(1, 3),
+ Edge.Create(2, 4)
});
graph.AddVertex(5);
@@ -503,9 +503,9 @@ private static AdjacencyGraph> CreateTestGraph()
var graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 1)
});
graph.AddVertexRange(new[] { 4, 5 });
return graph;
diff --git a/tests/QuikGraph.Graphviz.Tests/GraphvizAlgorithmTests.cs b/tests/QuikGraph.Graphviz.Tests/GraphvizAlgorithmTests.cs
index 02a8efc73..c6f11c2fe 100644
--- a/tests/QuikGraph.Graphviz.Tests/GraphvizAlgorithmTests.cs
+++ b/tests/QuikGraph.Graphviz.Tests/GraphvizAlgorithmTests.cs
@@ -97,9 +97,9 @@ public void FormatHandlers()
// With edges
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 1)
});
algorithm = new GraphvizAlgorithm>(graph);
notFormattedVertices = RegisterOnFormatVertex(algorithm, graph.Vertices);
@@ -127,7 +127,7 @@ public void FormatHandlers()
ClusteredAdjacencyGraph> subGraph1 = clusteredGraph.AddCluster();
subGraph1.AddVertexRange(new[] { 4, 5 });
ClusteredAdjacencyGraph> subGraph2 = clusteredGraph.AddCluster();
- subGraph2.AddVerticesAndEdge(new Edge(1, 6));
+ subGraph2.AddVerticesAndEdge(Edge.Create(1, 6));
algorithm = new GraphvizAlgorithm>(clusteredGraph);
notFormattedVertices = RegisterOnFormatVertex(algorithm, clusteredGraph.Vertices);
notFormattedEdges = RegisterOnFormatEdge(algorithm, clusteredGraph.Edges);
@@ -209,9 +209,9 @@ public void GenerateSameDot()
// With edges
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 1)
});
TestGenerate(graph);
@@ -223,7 +223,7 @@ public void GenerateSameDot()
ClusteredAdjacencyGraph> subGraph1 = clusteredGraph.AddCluster();
subGraph1.AddVertexRange(new[] { 4, 5 });
ClusteredAdjacencyGraph> subGraph2 = clusteredGraph.AddCluster();
- subGraph2.AddVerticesAndEdge(new Edge(1, 6));
+ subGraph2.AddVerticesAndEdge(Edge.Create(1, 6));
TestGenerate(clusteredGraph);
#region Local function
@@ -295,9 +295,9 @@ private static IEnumerable GenerateTestCases
graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 1)
});
yield return new TestCaseData(graph)
{
@@ -315,9 +315,9 @@ private static IEnumerable GenerateTestCases
undirectedGraph = new UndirectedGraph>();
undirectedGraph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 1)
});
yield return new TestCaseData(undirectedGraph)
{
@@ -352,11 +352,11 @@ private static IEnumerable GenerateTestCases
ClusteredAdjacencyGraph> subGraph1 = clusteredGraph.AddCluster();
subGraph1.AddVerticesAndEdgeRange(new[]
{
- new Edge(3, 4),
- new Edge(4, 1)
+ Edge.Create(3, 4),
+ Edge.Create(4, 1)
});
ClusteredAdjacencyGraph> subGraph2 = clusteredGraph.AddCluster();
- subGraph2.AddVerticesAndEdge(new Edge(1, 5));
+ subGraph2.AddVerticesAndEdge(Edge.Create(1, 5));
yield return new TestCaseData(clusteredGraph)
{
ExpectedResult =
@@ -403,33 +403,33 @@ private static IEnumerable GenerateTestCases
// Fill graphs
wrappedGraph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 2)
+ Edge.Create(1, 2),
+ Edge.Create(2, 2)
});
wrappedGraph.AddVertex(3);
- subClusteredGraph1.AddVerticesAndEdge(new Edge(4, 5));
+ subClusteredGraph1.AddVerticesAndEdge(Edge.Create(4, 5));
subClusteredGraph1.AddVertex(6);
- subClusteredGraph2.AddVerticesAndEdge(new Edge(7, 8));
+ subClusteredGraph2.AddVerticesAndEdge(Edge.Create(7, 8));
subClusteredGraph2.AddVertex(9);
- nestedSubClusteredGraph2_1.AddVerticesAndEdge(new Edge(10, 11));
+ nestedSubClusteredGraph2_1.AddVerticesAndEdge(Edge.Create(10, 11));
nestedSubClusteredGraph2_1.AddVertex(12);
- nestedSubClusteredGraph2_2.AddVerticesAndEdge(new Edge(13, 14));
+ nestedSubClusteredGraph2_2.AddVerticesAndEdge(Edge.Create(13, 14));
nestedSubClusteredGraph2_2.AddVertex(15);
- subClusteredGraph3.AddVerticesAndEdge(new Edge(16, 17));
+ subClusteredGraph3.AddVerticesAndEdge(Edge.Create(16, 17));
subClusteredGraph3.AddVertex(18);
- subClusteredGraph4.AddVerticesAndEdge(new Edge(19, 20));
+ subClusteredGraph4.AddVerticesAndEdge(Edge.Create(19, 20));
subClusteredGraph4.AddVertex(21);
- nestedSubClusteredGraph4_1.AddVerticesAndEdge(new Edge(22, 23));
+ nestedSubClusteredGraph4_1.AddVerticesAndEdge(Edge.Create(22, 23));
nestedSubClusteredGraph4_1.AddVertex(24);
- nestedSubClusteredGraph4_2.AddVerticesAndEdge(new Edge(25, 26));
+ nestedSubClusteredGraph4_2.AddVerticesAndEdge(Edge.Create(25, 26));
nestedSubClusteredGraph4_2.AddVertex(27);
yield return new TestCaseData(rootClusteredGraph)
@@ -517,33 +517,33 @@ private static IEnumerable GenerateTestCases
// Fill graphs
wrappedGraph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 2)
+ Edge.Create(1, 2),
+ Edge.Create(2, 2)
});
wrappedGraph.AddVertex(3);
- subClusteredGraph1.AddVerticesAndEdge(new Edge(4, 5));
+ subClusteredGraph1.AddVerticesAndEdge(Edge.Create(4, 5));
subClusteredGraph1.AddVertex(6);
- subClusteredGraph2.AddVerticesAndEdge(new Edge(7, 8));
+ subClusteredGraph2.AddVerticesAndEdge(Edge.Create(7, 8));
subClusteredGraph2.AddVertex(9);
- nestedSubClusteredGraph2_1.AddVerticesAndEdge(new Edge(10, 11));
+ nestedSubClusteredGraph2_1.AddVerticesAndEdge(Edge.Create(10, 11));
nestedSubClusteredGraph2_1.AddVertex(12);
- nestedSubClusteredGraph2_2.AddVerticesAndEdge(new Edge(13, 14));
+ nestedSubClusteredGraph2_2.AddVerticesAndEdge(Edge.Create(13, 14));
nestedSubClusteredGraph2_2.AddVertex(15);
- subClusteredGraph3.AddVerticesAndEdge(new Edge(16, 17));
+ subClusteredGraph3.AddVerticesAndEdge(Edge.Create(16, 17));
subClusteredGraph3.AddVertex(18);
- subClusteredGraph4.AddVerticesAndEdge(new Edge(19, 20));
+ subClusteredGraph4.AddVerticesAndEdge(Edge.Create(19, 20));
subClusteredGraph4.AddVertex(21);
- nestedSubClusteredGraph4_1.AddVerticesAndEdge(new Edge(22, 23));
+ nestedSubClusteredGraph4_1.AddVerticesAndEdge(Edge.Create(22, 23));
nestedSubClusteredGraph4_1.AddVertex(24);
- nestedSubClusteredGraph4_2.AddVerticesAndEdge(new Edge(25, 26));
+ nestedSubClusteredGraph4_2.AddVerticesAndEdge(Edge.Create(25, 26));
nestedSubClusteredGraph4_2.AddVertex(27);
// Collapse graphs
@@ -616,13 +616,13 @@ public void GenerateWithFormats()
var graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(1, 3),
- new Edge(3, 2),
- new Edge(3, 4),
- new Edge(4, 6),
- new Edge(5, 2),
- new Edge(5, 5)
+ Edge.Create(1, 2),
+ Edge.Create(1, 3),
+ Edge.Create(3, 2),
+ Edge.Create(3, 4),
+ Edge.Create(4, 6),
+ Edge.Create(5, 2),
+ Edge.Create(5, 5)
});
graph.AddVertex(7);
var clusteredGraph = new ClusteredAdjacencyGraph>(graph);
@@ -631,9 +631,9 @@ public void GenerateWithFormats()
ClusteredAdjacencyGraph> subGraph2 = clusteredGraph.AddCluster();
subGraph2.AddVerticesAndEdgeRange(new[]
{
- new Edge(11, 12),
- new Edge(11, 13),
- new Edge(12, 13)
+ Edge.Create(11, 12),
+ Edge.Create(11, 13),
+ Edge.Create(12, 13)
});
var algorithm = new GraphvizAlgorithm>(clusteredGraph);
diff --git a/tests/QuikGraph.Graphviz.Tests/Renderers/CondensatedGraphRendererTests.cs b/tests/QuikGraph.Graphviz.Tests/Renderers/CondensatedGraphRendererTests.cs
index c672da25d..a8276a12b 100644
--- a/tests/QuikGraph.Graphviz.Tests/Renderers/CondensatedGraphRendererTests.cs
+++ b/tests/QuikGraph.Graphviz.Tests/Renderers/CondensatedGraphRendererTests.cs
@@ -49,25 +49,25 @@ private static IEnumerable GenerateTestCases
var subGraph1 = new AdjacencyGraph>();
subGraph1.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 1)
});
var subGraph2 = new AdjacencyGraph>();
subGraph2.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 1),
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 2)
+ Edge.Create(1, 1),
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 2)
});
var subGraph3 = new AdjacencyGraph>();
subGraph3.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 4),
- new Edge(2, 4)
+ Edge.Create(1, 4),
+ Edge.Create(2, 4)
});
subGraph3.AddVertex(3);
@@ -95,34 +95,34 @@ private static IEnumerable GenerateTestCases
subGraph1 = new AdjacencyGraph>();
subGraph1.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 1)
});
subGraph2 = new AdjacencyGraph>();
subGraph2.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 1),
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(3, 2)
+ Edge.Create(1, 1),
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(3, 2)
});
subGraph3 = new AdjacencyGraph>();
subGraph3.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 4),
- new Edge(2, 4)
+ Edge.Create(1, 4),
+ Edge.Create(2, 4)
});
subGraph3.AddVertex(3);
graph = new AdjacencyGraph>, CondensedEdge, AdjacencyGraph>>>();
var condensedEdge1 = new CondensedEdge, AdjacencyGraph>>(subGraph1, subGraph2);
- condensedEdge1.Edges.Add(new Edge(1, 2));
+ condensedEdge1.Edges.Add(Edge.Create(1, 2));
var condensedEdge2 = new CondensedEdge, AdjacencyGraph>>(subGraph1, subGraph3);
- condensedEdge2.Edges.Add(new Edge(2, 1));
- condensedEdge2.Edges.Add(new Edge(3, 4));
+ condensedEdge2.Edges.Add(Edge.Create(2, 1));
+ condensedEdge2.Edges.Add(Edge.Create(3, 4));
var condensedEdge3 = new CondensedEdge, AdjacencyGraph>>(subGraph2, subGraph3);
graph.AddVerticesAndEdgeRange(new[] { condensedEdge1, condensedEdge2, condensedEdge3 });
diff --git a/tests/QuikGraph.Graphviz.Tests/Renderers/EdgeMergeCondensatedGraphRendererTests.cs b/tests/QuikGraph.Graphviz.Tests/Renderers/EdgeMergeCondensatedGraphRendererTests.cs
index b0a569467..ad0dc1324 100644
--- a/tests/QuikGraph.Graphviz.Tests/Renderers/EdgeMergeCondensatedGraphRendererTests.cs
+++ b/tests/QuikGraph.Graphviz.Tests/Renderers/EdgeMergeCondensatedGraphRendererTests.cs
@@ -48,17 +48,17 @@ private static IEnumerable GenerateTestCases
graph = new AdjacencyGraph>>();
graph.AddVertexRange(new[] { 4, 8 });
- var edge12 = new Edge(1, 2);
- var edge13 = new Edge(1, 3);
- var edge23 = new Edge(2, 3);
- var edge38 = new Edge(3, 8);
- var edge42 = new Edge(4, 2);
- var edge43 = new Edge(4, 3);
- var edge44 = new Edge(4, 4);
- var edge45 = new Edge(4, 5);
- var edge57 = new Edge(5, 7);
- var edge71 = new Edge(7, 1);
- var edge82 = new Edge(8, 2);
+ var edge12 = Edge.Create(1, 2);
+ var edge13 = Edge.Create(1, 3);
+ var edge23 = Edge.Create(2, 3);
+ var edge38 = Edge.Create(3, 8);
+ var edge42 = Edge.Create(4, 2);
+ var edge43 = Edge.Create(4, 3);
+ var edge44 = Edge.Create(4, 4);
+ var edge45 = Edge.Create(4, 5);
+ var edge57 = Edge.Create(5, 7);
+ var edge71 = Edge.Create(7, 1);
+ var edge82 = Edge.Create(8, 2);
var mergeEdge1 = new MergedEdge>(8, 8);
mergeEdge1.Edges.Add(edge82);
diff --git a/tests/QuikGraph.MSAGL.Tests/Events/MsaglEdgeEventArgsTests.cs b/tests/QuikGraph.MSAGL.Tests/Events/MsaglEdgeEventArgsTests.cs
index 688c8530d..779e26097 100644
--- a/tests/QuikGraph.MSAGL.Tests/Events/MsaglEdgeEventArgsTests.cs
+++ b/tests/QuikGraph.MSAGL.Tests/Events/MsaglEdgeEventArgsTests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.Msagl.Drawing;
using NUnit.Framework;
@@ -12,8 +12,8 @@ internal sealed class MsaglEdgeEventArgsTests
[Test]
public void Constructor()
{
- var edge = new Edge(1, 2);
- var msaglEdge = new Edge(new Node("1"), new Node("2"), ConnectionToGraph.Disconnected);
+ var edge = Edge.Create(1, 2);
+ var msaglEdge = new Microsoft.Msagl.Drawing.Edge(new Node("1"), new Node("2"), ConnectionToGraph.Disconnected);
var args = new MsaglEdgeEventArgs>(edge, msaglEdge);
Assert.AreSame(edge, args.Edge);
@@ -23,8 +23,8 @@ public void Constructor()
[Test]
public void Constructor_Throws()
{
- var edge = new Edge(1, 2);
- var msaglEdge = new Edge(new Node("1"), new Node("2"), ConnectionToGraph.Disconnected);
+ var edge = Edge.Create(1, 2);
+ var msaglEdge = new Microsoft.Msagl.Drawing.Edge(new Node("1"), new Node("2"), ConnectionToGraph.Disconnected);
// ReSharper disable ObjectCreationAsStatement
// ReSharper disable AssignNullToNotNullAttribute
diff --git a/tests/QuikGraph.MSAGL.Tests/MsaglGraphExtensionsTests.cs b/tests/QuikGraph.MSAGL.Tests/MsaglGraphExtensionsTests.cs
index 5950e56cf..46faaac5e 100644
--- a/tests/QuikGraph.MSAGL.Tests/MsaglGraphExtensionsTests.cs
+++ b/tests/QuikGraph.MSAGL.Tests/MsaglGraphExtensionsTests.cs
@@ -82,11 +82,11 @@ public void ToMsaglGraph()
graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(2, 5),
- new Edge(3, 4),
- new Edge(4, 3)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(2, 5),
+ Edge.Create(3, 4),
+ Edge.Create(4, 3)
});
graph.AddVertex(6);
ToMsaglGraph_Test(graph);
@@ -94,11 +94,11 @@ public void ToMsaglGraph()
var undirectedGraph = new UndirectedGraph>();
undirectedGraph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3),
- new Edge(2, 5),
- new Edge(3, 4),
- new Edge(4, 3)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3),
+ Edge.Create(2, 5),
+ Edge.Create(3, 4),
+ Edge.Create(4, 3)
});
undirectedGraph.AddVertex(6);
ToMsaglGraph_Test(undirectedGraph);
diff --git a/tests/QuikGraph.MSAGL.Tests/MsaglGraphPopulatorTestsBase.cs b/tests/QuikGraph.MSAGL.Tests/MsaglGraphPopulatorTestsBase.cs
index 12f58ccde..50953ba54 100644
--- a/tests/QuikGraph.MSAGL.Tests/MsaglGraphPopulatorTestsBase.cs
+++ b/tests/QuikGraph.MSAGL.Tests/MsaglGraphPopulatorTestsBase.cs
@@ -34,9 +34,9 @@ protected static void Compute_Test(
graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(1, 3),
- new Edge(2, 3)
+ Edge.Create(1, 2),
+ Edge.Create(1, 3),
+ Edge.Create(2, 3)
});
graph.AddVertexRange(new[] { 5, 6 });
populator = createPopulator(graph);
@@ -47,11 +47,11 @@ protected static void Compute_Test(
graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(1, 3),
- new Edge(2, 4),
- new Edge(3, 1),
- new Edge(4, 1)
+ Edge.Create(1, 2),
+ Edge.Create(1, 3),
+ Edge.Create(2, 4),
+ Edge.Create(3, 1),
+ Edge.Create(4, 1)
});
populator = createPopulator(graph);
populator.Compute();
@@ -61,10 +61,10 @@ protected static void Compute_Test(
graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(1, 3),
- new Edge(2, 2),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(1, 3),
+ Edge.Create(2, 2),
+ Edge.Create(3, 1)
});
populator = createPopulator(graph);
populator.Compute();
@@ -74,10 +74,10 @@ protected static void Compute_Test(
var undirectedGraph = new UndirectedGraph>();
undirectedGraph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(1, 3),
- new Edge(2, 4),
- new Edge(3, 1)
+ Edge.Create(1, 2),
+ Edge.Create(1, 3),
+ Edge.Create(2, 4),
+ Edge.Create(3, 1)
});
populator = createPopulator(undirectedGraph);
populator.Compute();
@@ -111,9 +111,9 @@ protected static void Handlers_Test(
CollectionAssert.IsEmpty(expectedVerticesAdded);
// With vertices and edges
- var edge12 = new Edge(1, 2);
- var edge13 = new Edge(1, 3);
- var edge23 = new Edge(2, 3);
+ var edge12 = Edge.Create(1, 2);
+ var edge13 = Edge.Create(1, 3);
+ var edge23 = Edge.Create(2, 3);
graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[] { edge12, edge13, edge23 });
graph.AddVertexRange(new[] { 5, 6 });
diff --git a/tests/QuikGraph.MSAGL.Tests/MsaglIdentifiableGraphPopulatorTests.cs b/tests/QuikGraph.MSAGL.Tests/MsaglIdentifiableGraphPopulatorTests.cs
index 0f61211e1..4f08ad1fa 100644
--- a/tests/QuikGraph.MSAGL.Tests/MsaglIdentifiableGraphPopulatorTests.cs
+++ b/tests/QuikGraph.MSAGL.Tests/MsaglIdentifiableGraphPopulatorTests.cs
@@ -71,8 +71,8 @@ public void VertexId()
var graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3)
});
graph.AddVertexRange(new[] { 5, 6 });
diff --git a/tests/QuikGraph.MSAGL.Tests/MsaglToStringGraphPopulatorTests.cs b/tests/QuikGraph.MSAGL.Tests/MsaglToStringGraphPopulatorTests.cs
index cbb88fb12..b870ba12c 100644
--- a/tests/QuikGraph.MSAGL.Tests/MsaglToStringGraphPopulatorTests.cs
+++ b/tests/QuikGraph.MSAGL.Tests/MsaglToStringGraphPopulatorTests.cs
@@ -109,8 +109,8 @@ public void VertexId()
var graph = new AdjacencyGraph>();
graph.AddVerticesAndEdgeRange(new[]
{
- new Edge(1, 2),
- new Edge(2, 3)
+ Edge.Create(1, 2),
+ Edge.Create(2, 3)
});
graph.AddVertexRange(new[] { 5, 6 });
diff --git a/tests/QuikGraph.Serialization.Tests/XmlSerializableStructuresTests.cs b/tests/QuikGraph.Serialization.Tests/XmlSerializableStructuresTests.cs
index 101c2f357..38e873312 100644
--- a/tests/QuikGraph.Serialization.Tests/XmlSerializableStructuresTests.cs
+++ b/tests/QuikGraph.Serialization.Tests/XmlSerializableStructuresTests.cs
@@ -124,8 +124,8 @@ public void XmlSerializableGraph()
graph.Vertices);
CollectionAssert.IsEmpty(graph.Edges);
- var edge12 = new Edge(1, 2);
- var edge22 = new Edge(2, 2);
+ var edge12 = Edge.Create(1, 2);
+ var edge22 = Edge.Create(2, 2);
var edges = new XmlSerializableGraph, AdjacencyGraph>>.XmlEdgeList(wrappedGraph)
{
edge12, edge22
@@ -157,8 +157,8 @@ public void XmlVertexList()
CollectionAssert.IsEmpty(vertexList);
- var edge12 = new Edge(1, 2);
- var edge22 = new Edge(2, 2);
+ var edge12 = Edge.Create(1, 2);
+ var edge22 = Edge.Create(2, 2);
graph.AddVerticesAndEdgeRange(new[] { edge12, edge22 });
CollectionAssert.AreEqual(
@@ -221,8 +221,8 @@ public void XmlEdgeList()
CollectionAssert.IsEmpty(edgeList);
- var edge12 = new Edge(1, 2);
- var edge22 = new Edge(2, 2);
+ var edge12 = Edge.Create(1, 2);
+ var edge22 = Edge.Create(2, 2);
graph.AddVerticesAndEdgeRange(new[] { edge12, edge22 });
CollectionAssert.AreEqual(
@@ -255,14 +255,14 @@ public void XmlEdgeList_Add()
CollectionAssert.IsEmpty(edgeList);
- var edge12 = new Edge(1, 2);
+ var edge12 = Edge.Create(1, 2);
edgeList.Add(edge12);
CollectionAssert.AreEqual(
new[] { edge12 },
edgeList);
- var edge22 = new Edge(2, 2);
+ var edge22 = Edge.Create(2, 2);
edgeList.Add(edge22);
CollectionAssert.AreEqual(
diff --git a/tests/QuikGraph.Tests/Algorithms/Cliques/MaximumCliqueAlgorithmTests.cs b/tests/QuikGraph.Tests/Algorithms/Cliques/MaximumCliqueAlgorithmTests.cs
index ff2f82da0..2fd1c2acf 100644
--- a/tests/QuikGraph.Tests/Algorithms/Cliques/MaximumCliqueAlgorithmTests.cs
+++ b/tests/QuikGraph.Tests/Algorithms/Cliques/MaximumCliqueAlgorithmTests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using JetBrains.Annotations;
using NUnit.Framework;
using QuikGraph.Algorithms.Cliques;
@@ -13,8 +13,6 @@ namespace QuikGraph.Tests.Algorithms.Cliques
[TestFixture]
internal sealed class MaximumCliqueAlgorithmTests
{
- #region Test classes
-
private class TestMaximumCliqueAlgorithm : MaximumCliqueAlgorithmBase
where TEdge : IEdge
{
@@ -35,8 +33,6 @@ protected override void InternalCompute()
}
}
- #endregion
-
[Test]
public void Constructor()
{
diff --git a/tests/QuikGraph.Tests/Algorithms/Condensation/CondensationGraphAlgorithmTestsBase.cs b/tests/QuikGraph.Tests/Algorithms/Condensation/CondensationGraphAlgorithmTestsBase.cs
index ab723226d..cb1cfdc2f 100644
--- a/tests/QuikGraph.Tests/Algorithms/Condensation/CondensationGraphAlgorithmTestsBase.cs
+++ b/tests/QuikGraph.Tests/Algorithms/Condensation/CondensationGraphAlgorithmTestsBase.cs
@@ -1,4 +1,4 @@
-using JetBrains.Annotations;
+using JetBrains.Annotations;
using NUnit.Framework;
using QuikGraph.Algorithms;
using QuikGraph.Algorithms.Condensation;
@@ -10,8 +10,6 @@ namespace QuikGraph.Tests.Algorithms.Condensation
///
internal abstract class CondensationGraphAlgorithmTestsBase
{
- #region Test helpers
-
protected static void CheckVertexCount(
[NotNull] IVertexSet graph,
[NotNull] IVertexSet> condensedGraph)
@@ -44,6 +42,5 @@ protected static void CheckDAG(
Assert.IsTrue(condensedGraph.IsDirectedAcyclicGraph());
}
- #endregion
}
}
\ No newline at end of file
diff --git a/tests/QuikGraph.Tests/Algorithms/Condensation/CondensededEdgeTests.cs b/tests/QuikGraph.Tests/Algorithms/Condensation/CondensededEdgeTests.cs
index 79a8b458c..74b366ac4 100644
--- a/tests/QuikGraph.Tests/Algorithms/Condensation/CondensededEdgeTests.cs
+++ b/tests/QuikGraph.Tests/Algorithms/Condensation/CondensededEdgeTests.cs
@@ -12,7 +12,7 @@ namespace QuikGraph.Tests.Algorithms.Condensation
internal sealed class CondensedEdgeTests : EdgeTestsBase
{
[Test]
- public void Construction()
+ public void TestConstruction()
{
var graph1 = new AdjacencyGraph>();
var graph2 = new AdjacencyGraph>();
@@ -64,7 +64,7 @@ public void Construction_Throws()
}
[Test]
- public void Edges()
+ public void TestEdges()
{
var graph1 = new AdjacencyGraph>();
var graph2 = new AdjacencyGraph>();
@@ -72,7 +72,7 @@ public void Edges()
var edge = new CondensedEdge, AdjacencyGraph>>(graph1, graph2);
CollectionAssert.IsEmpty(edge.Edges);
- var subEdge = new Edge(1, 2);
+ var subEdge = Edge.Create(1, 2);
edge.Edges.Add(subEdge);
CollectionAssert.AreEqual(new[] { subEdge }, edge.Edges);
@@ -81,7 +81,7 @@ public void Edges()
}
[Test]
- public void Equals()
+ public void TestEquals()
{
var graph1 = new AdjacencyGraph>();
var graph2 = new AdjacencyGraph>();
@@ -91,7 +91,7 @@ public void Equals()
var edge3 = new CondensedEdge, AdjacencyGraph>>(graph2, graph1);
var edge4 = new CondensedEdge, AdjacencyGraph>>(graph1, graph2);
- var subEdge = new Edge(1, 2);
+ var subEdge = Edge.Create(1, 2);
edge4.Edges.Add(subEdge);
Assert.AreEqual(edge1, edge1);
diff --git a/tests/QuikGraph.Tests/Algorithms/Condensation/EdgeMergeCondensationGraphAlgorithmTests.cs b/tests/QuikGraph.Tests/Algorithms/Condensation/EdgeMergeCondensationGraphAlgorithmTests.cs
index ddd992a5c..fa5a2b262 100644
--- a/tests/QuikGraph.Tests/Algorithms/Condensation/EdgeMergeCondensationGraphAlgorithmTests.cs
+++ b/tests/QuikGraph.Tests/Algorithms/Condensation/EdgeMergeCondensationGraphAlgorithmTests.cs
@@ -15,7 +15,6 @@ namespace QuikGraph.Tests.Algorithms.Condensation
[TestFixture]
internal sealed class EdgeMergeCondensationGraphAlgorithmTests
{
- #region Test helpers
private static void RunEdgesCondensationAndCheck(
[NotNull] IBidirectionalGraph graph,
@@ -40,8 +39,6 @@ private static void RunEdgesCondensationAndCheck(
}
}
- #endregion
-
[Test]
public void Constructor()
{
@@ -101,23 +98,23 @@ private static IEnumerable EdgeCondensationAllVerticesTestCases
[UsedImplicitly]
get
{
- var edge12 = new Edge(1, 2);
- var edge13 = new Edge(1, 3);
- var edge23 = new Edge(2, 3);
- var edge42 = new Edge(4, 2);
- var edge43 = new Edge(4, 3);
+ var edge12 = Edge.Create(1, 2);
+ var edge13 = Edge.Create(1, 3);
+ var edge23 = Edge.Create(2, 3);
+ var edge42 = Edge.Create(4, 2);
+ var edge43 = Edge.Create(4, 3);
- var edge45 = new Edge(4, 5);
+ var edge45 = Edge.Create(4, 5);
- var edge56 = new Edge(5, 6);
- var edge57 = new Edge(5, 7);
- var edge76 = new Edge