From 9481e541ca553932e1474a0a138e2e56aecda2a9 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 17 Oct 2026 19:35:04 +0200 Subject: [PATCH] PlaceNamesTests: a home zone shared by two factions takes its owner's capital The prelude puts the quest faction's home on the buffer faction's, and a zone has one owner (the nearest home in faction order), so the first full run showed Adrasteia's home zone named Ishtar Studios, Lucent's capital. The rule stands; the test said the wrong thing about the shared home. Co-Authored-By: Claude Opus 5.5 --- .../Aetheria.Shared.Tests/PlaceNamesTests.cs | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/PlaceNamesTests.cs b/tests/Aetheria.Shared.Tests/PlaceNamesTests.cs index a26925a36..b47d41c74 100644 --- a/tests/Aetheria.Shared.Tests/PlaceNamesTests.cs +++ b/tests/Aetheria.Shared.Tests/PlaceNamesTests.cs @@ -59,17 +59,25 @@ public sealed class PlaceNamesTests : IDisposable galaxy.Zones.Select((zone, index) => (zone, index)).Where(z => z.zone.Owner == faction) .OrderBy(z => z.zone.Distance[galaxy.HomeZones[faction]]).ThenBy(z => z.index).Select(z => z.zone).ToArray(); + // Two factions can share a home zone (the prelude puts the quest faction on the buffer's); the zone's owner is the + // nearest home in faction order, and that owner's capital is what the zone is called. [Fact] - public void TheHomeZoneTakesTheFirstName() + public void TheHomeZoneTakesTheOwnersFirstName() { - var checkedHomes = 0; + var own = 0; + var shared = 0; foreach (var galaxy in Galaxies(true, 10).Concat(Galaxies(false, 10))) - foreach (var faction in Placed(galaxy)) + foreach (var faction in galaxy.Factions.Where(galaxy.HomeZones.ContainsKey)) { - Assert.Equal(faction.Places[0].Name, galaxy.HomeZones[faction].Name); - checkedHomes++; + var home = galaxy.HomeZones[faction]; + var owner = home.Owner; + Assert.NotNull(owner); + if (owner.Places.Length == 0) Assert.Matches(Designation, home.Name); + else Assert.Equal(owner.Places[0].Name, home.Name); + if (owner == faction) own++; else shared++; } - Assert.True(checkedHomes >= 20, $"only {checkedHomes} homes were checked"); + Assert.True(own >= 20, $"only {own} factions owned their home"); + Assert.True(shared > 0, "no galaxy shared a home zone, so the shared case was not exercised"); } [Fact]