Skip to content

Commit a5753fc

Browse files
author
David Karlaš
committed
Added unit test
1 parent 7d497d5 commit a5753fc

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/Itinero.Tests/Routing/IRouterOneToOneExtensionsTests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,29 @@ public async Task IRouterOneToOneExtensions_Calculate_TwoEdge_With2ShapePoints_S
246246
Assert.True((4.802438914775848, 51.268097745847650, (float?)null).DistanceEstimateInMeter(route.Shape[6]) <
247247
1);
248248
}
249+
250+
[Fact]
251+
public async Task IRouterOneToOneExtensions_Two_Vertices_Close_Together()
252+
{
253+
var (routerDb, _, _) = RouterDbScaffolding.BuildRouterDb([
254+
(5.5253315, 50.6592083, null),
255+
(5.5245052, 50.6595263, null),
256+
(5.5245005, 50.6595282, null),
257+
(5.5241723, 50.6596545, null)
258+
],
259+
[(0, 1, null),
260+
(1, 2, null),
261+
(2, 3, null)]);
262+
263+
var network = routerDb.Latest;
264+
265+
var snap1 = await network.Snap().ToAsync((5.5253315, 50.6592083, null));
266+
var snap2 = await network.Snap().ToAsync((5.5241723, 50.6596545, null));
267+
268+
var result = await routerDb.Latest.Route(new DefaultProfile())
269+
.From(snap1).To(snap2).CalculateAsync();
270+
Assert.False(result.IsError);
271+
var route = result.Value;
272+
Assert.NotNull(route.Shape);
273+
}
249274
}

0 commit comments

Comments
 (0)