From f9ece91638c0dcafd4e117e6ce68b56ede1a0400 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 16 Oct 2026 21:39:05 +0200 Subject: [PATCH] Boss gate test: the main galaxy places no boss in the shipped catalog, so give it one off the exit Fixes the previous commit's Exit_open_only_in_the_exit_zone, which asserted bosses the main galaxy does not have. Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/RunGoalTests.cs | 24 +++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/RunGoalTests.cs b/tests/Aetheria.Shared.Tests/RunGoalTests.cs index d1107b959..ed96732c9 100644 --- a/tests/Aetheria.Shared.Tests/RunGoalTests.cs +++ b/tests/Aetheria.Shared.Tests/RunGoalTests.cs @@ -196,17 +196,19 @@ public sealed partial class RunStartTests public void Exit_open_only_in_the_exit_zone() { var galaxy = RunStart.Generate(new MainGalaxy(), Inputs(() => 1)); - var others = galaxy.BossZones.Values.Where(zone => zone != galaxy.Exit).Distinct().ToArray(); - Assert.NotEmpty(others); - foreach (var bossZone in others) - { - var zone = ZoneOf(galaxy, bossZone); - Assert.True(zone.Pack.BossSpawned); - foreach (var boss in zone.Entities.Where(entity => entity.IsBoss).ToArray()) - boss.HeatstrokeDeath.OnNext(Unit.Default); - Assert.False(RunGoal.BossAlive(zone)); - Assert.False(RunGoal.ExitOpen(zone)); - } + // The shipped catalog sets no BossHull outside the demo's antagonist, so the main galaxy places no boss: give a + // faction one and a boss zone that is not the exit, as the generator would for a faction with a boss hull. + var faction = galaxy.Factions.First(); + faction.BossHull = _cache.RefOf(SoldShipHulls().First()); + var bossZone = galaxy.Zones.First(zone => zone != galaxy.Exit); + galaxy.BossZones[faction] = bossZone; + var zone = ZoneOf(galaxy, bossZone); + Assert.True(zone.Pack.BossSpawned); + Assert.NotEmpty(zone.Entities.Where(entity => entity.IsBoss)); + foreach (var boss in zone.Entities.Where(entity => entity.IsBoss).ToArray()) + boss.HeatstrokeDeath.OnNext(Unit.Default); + Assert.False(RunGoal.BossAlive(zone)); + Assert.False(RunGoal.ExitOpen(zone)); } // A boss that cannot be generated (no ship hull on offer at all) never marks the zone as having spawned one.