capitalize enum
parent
68efeb9712
commit
4e5a5eb06b
|
@ -6,8 +6,8 @@ namespace MoonTools.Core.Graph
|
|||
{
|
||||
public enum SearchSymbol
|
||||
{
|
||||
start,
|
||||
finish
|
||||
Start,
|
||||
Finish
|
||||
}
|
||||
|
||||
public class DirectedGraph<TNode, TEdgeData> : IGraph<TNode, TEdgeData> where TNode : IEquatable<TNode>
|
||||
|
@ -154,7 +154,7 @@ namespace MoonTools.Core.Graph
|
|||
{
|
||||
discovered.Add(v);
|
||||
time++;
|
||||
output[v].Add(SearchSymbol.start, time);
|
||||
output[v].Add(SearchSymbol.Start, time);
|
||||
|
||||
foreach (var neighbor in Neighbors(v))
|
||||
{
|
||||
|
@ -165,7 +165,7 @@ namespace MoonTools.Core.Graph
|
|||
}
|
||||
|
||||
time++;
|
||||
output[v].Add(SearchSymbol.finish, time);
|
||||
output[v].Add(SearchSymbol.Finish, time);
|
||||
}
|
||||
|
||||
foreach (var node in Nodes)
|
||||
|
@ -190,7 +190,7 @@ namespace MoonTools.Core.Graph
|
|||
var priority = new SortedList<uint, TNode>();
|
||||
foreach (var entry in dfs)
|
||||
{
|
||||
priority.Add(entry.Value[SearchSymbol.finish], entry.Key);
|
||||
priority.Add(entry.Value[SearchSymbol.Finish], entry.Key);
|
||||
}
|
||||
return priority.Values.Reverse();
|
||||
}
|
||||
|
|
|
@ -111,17 +111,17 @@ namespace Tests
|
|||
|
||||
var result = myGraph.NodeDFS();
|
||||
|
||||
Assert.That(result['a'][SearchSymbol.start], Is.EqualTo(1));
|
||||
Assert.That(result['a'][SearchSymbol.finish], Is.EqualTo(8));
|
||||
Assert.That(result['a'][SearchSymbol.Start], Is.EqualTo(1));
|
||||
Assert.That(result['a'][SearchSymbol.Finish], Is.EqualTo(8));
|
||||
|
||||
Assert.That(result['b'][SearchSymbol.start], Is.EqualTo(2));
|
||||
Assert.That(result['b'][SearchSymbol.finish], Is.EqualTo(5));
|
||||
Assert.That(result['b'][SearchSymbol.Start], Is.EqualTo(2));
|
||||
Assert.That(result['b'][SearchSymbol.Finish], Is.EqualTo(5));
|
||||
|
||||
Assert.That(result['c'][SearchSymbol.start], Is.EqualTo(6));
|
||||
Assert.That(result['c'][SearchSymbol.finish], Is.EqualTo(7));
|
||||
Assert.That(result['c'][SearchSymbol.Start], Is.EqualTo(6));
|
||||
Assert.That(result['c'][SearchSymbol.Finish], Is.EqualTo(7));
|
||||
|
||||
Assert.That(result['d'][SearchSymbol.start], Is.EqualTo(3));
|
||||
Assert.That(result['d'][SearchSymbol.finish], Is.EqualTo(4));
|
||||
Assert.That(result['d'][SearchSymbol.Start], Is.EqualTo(3));
|
||||
Assert.That(result['d'][SearchSymbol.Finish], Is.EqualTo(4));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
Loading…
Reference in New Issue