Skip to content

Commit 88d1ee6

Browse files
committed
update net40 example
1 parent ea929cc commit 88d1ee6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Samples/Dijkstra.Net40/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Linq;
33
using Dijkstra.NET.Contract;
4+
using Dijkstra.NET.Extensions;
45
using Dijkstra.NET.Model;
56
using Dijkstra.NET.ShortestPath;
67

@@ -24,13 +25,15 @@ static void Main(string[] args)
2425

2526
graph.Reset();
2627

28+
var immutablePath = graph.Dijkstra(0, 1);
29+
2730
var bfs = new BfsParallel<int, string>(graph);
2831

2932
IShortestPathResult bfsResult = bfs.Process(0, 1);
3033

3134
var bfsPath = bfsResult.GetPath();
3235

33-
if (!bfsPath.SequenceEqual(path))
36+
if (!bfsPath.SequenceEqual(path) || !immutablePath.GetPath().SequenceEqual(path))
3437
{
3538
throw new Exception("The path should be the same.");
3639
}

0 commit comments

Comments
 (0)