feat(proj): add graph
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using TileServer.Application.Graph;
|
||||
using TileServer.Domain.Exceptions;
|
||||
using TileServer.Domain.Graph;
|
||||
using TileServer.Infrastructure.Graph;
|
||||
|
||||
namespace TileServer.UnitTests;
|
||||
|
||||
public sealed class RoadGraphTests
|
||||
{
|
||||
[Fact]
|
||||
public void Haversine_MoscowBlock_IsRoughlyHundredMeters()
|
||||
{
|
||||
var meters = OsmSharpRoadGraphBuilder.HaversineMeters(37.6173, 55.7558, 37.6185, 55.7558);
|
||||
Assert.InRange(meters, 60, 120);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ValidateBounds_RejectsWideBbox()
|
||||
{
|
||||
Assert.Throws<DomainValidationException>(() =>
|
||||
RoadGraphQueryService.ValidateBounds(new RoadGraphBounds(37, 55, 40, 56)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ValidateBounds_AcceptsSmallBbox()
|
||||
{
|
||||
RoadGraphQueryService.ValidateBounds(new RoadGraphBounds(37.5, 55.7, 37.7, 55.8));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user