feat(proj): add graph

This commit is contained in:
vl.arkhangelskii
2026-09-21 11:33:24 +03:00
parent bffc5d743c
commit b763b6f050
23 changed files with 1067 additions and 25 deletions
@@ -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));
}
}