Skip to content

Commit 5a908ab

Browse files
committed
added Id to all Test Graphs to get more granular Results
1 parent 08b389b commit 5a908ab

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/QuikGraph/Structures/Graphs/AdjacencyGraph.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ public bool ContainsVertex(TVertex vertex)
118118
/// <inheritdoc />
119119
public virtual IEnumerable<TEdge> Edges => _vertexEdges.Values.SelectMany(edges => edges);
120120

121+
/// <summary> Optional Id for this Graph </summary>
122+
public string Id { get; set; }
123+
124+
/// <inheritdoc />
125+
public override string ToString() => GetType().Name + ": " + Id;
126+
121127
/// <inheritdoc />
122128
public bool ContainsEdge(TEdge edge)
123129
{

src/QuikGraph/Structures/Graphs/BidirectionalGraph.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ public bool ContainsVertex(TVertex vertex)
140140
/// <inheritdoc />
141141
public virtual IEnumerable<TEdge> Edges => _vertexOutEdges.Values.SelectMany(edges => edges);
142142

143+
/// <summary> Optional Id for this Graph </summary>
144+
public string Id { get; set; }
145+
146+
/// <inheritdoc />
147+
public override string ToString() => GetType().Name + ": " + Id;
148+
149+
143150
/// <inheritdoc />
144151
public bool ContainsEdge(TEdge edge)
145152
{

tests/QuikGraph.Serialization.Tests.CommonInternals/TestGraphFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static AdjacencyGraph<string, Edge<string>> LoadGraph([NotNull] string gr
5454
id => id,
5555
(source, target, _) => new Edge<string>(source, target));
5656
}
57-
57+
graph.Id = Path.GetFileNameWithoutExtension(graphMLFilePath);
5858
return graph;
5959
}
6060

@@ -71,7 +71,7 @@ public static BidirectionalGraph<string, Edge<string>> LoadBidirectionalGraph([N
7171
id => id,
7272
(source, target, _) => new Edge<string>(source, target));
7373
}
74-
74+
graph.Id = Path.GetFileNameWithoutExtension(graphMLFilePath);
7575
return graph;
7676
}
7777

0 commit comments

Comments
 (0)