Add map markers for tiny countries that have a polygon
Build and deploy / build (push) Successful in 1m32s
Build and deploy / deploy (push) Successful in 20s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
TomandClaude Sonnet 5.5 committed 2026-11-16 23:10:05 +01:00
1 parent aeafaa71a8
commit 7d3e6f8842
3 files changed
+21 -6

No files matched your search

+14 -5
View File
@@ -38,14 +38,23 @@ public sealed class WorldMapDataTests
public void Small_bot_heavy_countries_have_markers(string code) =>
_map.Markers.ShouldContain(m => m.Code == code);
[Fact]
public void No_country_has_both_a_polygon_and_a_marker()
[Theory]
[InlineData("IL")]
[InlineData("LB")]
[InlineData("PS")]
[InlineData("KW")]
[InlineData("QA")]
[InlineData("NL")]
public void Tiny_countries_with_a_polygon_also_have_a_marker(string code)
{
var polygons = _map.Countries.Select(c => c.Code).OfType<string>().ToHashSet();
_map.Markers.Where(m => polygons.Contains(m.Code)).ShouldBeEmpty();
_map.Countries.ShouldContain(c => c.Code == code);
_map.Markers.ShouldContain(m => m.Code == code);
}
[Fact]
public void Markers_are_unique_per_country() =>
_map.Markers.Select(m => m.Code).ShouldBeUnique();
[Fact]
public void Markers_lie_inside_the_map() =>
_map.Markers.ShouldAllBe(m => m.X >= 0 && m.X <= _map.Width && m.Y >= 0 && m.Y <= _map.Height);