From 90f977bf19a6bd42741459cf371ddee5a492462d Mon Sep 17 00:00:00 2001
From: Meta Vens
Date: Sun, 18 Oct 2026 20:33:09 +0200
Subject: [PATCH] Boss tests: a null faction has no boss hull; an unbuildable
boss Loadout lists every failure
Co-Authored-By: Claude Sonnet 5.5
---
tests/Aetheria.Shared.Tests/RunGoalTests.cs | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/tests/Aetheria.Shared.Tests/RunGoalTests.cs b/tests/Aetheria.Shared.Tests/RunGoalTests.cs
index 5e0d6b521..6e171b33a 100644
--- a/tests/Aetheria.Shared.Tests/RunGoalTests.cs
+++ b/tests/Aetheria.Shared.Tests/RunGoalTests.cs
@@ -281,6 +281,21 @@ public sealed partial class RunStartTests
Assert.Empty(LoadoutGenerator.BossHullsOf(_cache, null));
}
+ // No faction has no boss hulls, even when a Boss hull has a product with no maker (which a null faction would equal).
+ [Fact]
+ public void No_faction_has_no_boss_hull()
+ {
+ var galaxy = DemoGalaxy(1);
+ var orphan = MakeBoss("Orphan Boss", 100);
+ var key = _cache.RefOf(orphan).Key;
+ _cache.Upsert(new FactionProductData { Name = "Orphan product", Design = new CultRecordRef(key) });
+
+ Assert.Empty(LoadoutGenerator.BossHullsOf(_cache, null));
+ Assert.Null(Loadouts.BossOf(_cache, null, out var refusal));
+ Assert.Equal(BossRefusal.NoBossHull, refusal);
+ Assert.Empty(LoadoutGenerator.BossHullsOf(_cache, Zhestokost(galaxy)));
+ }
+
// A Boss hull whose product has no Loadout is refused typed at the derivation. The refusal names the missing field and
// echoes no input: the canary hull name, its product's name and the record keys reach no log line.
[Fact]
@@ -590,6 +605,7 @@ public sealed partial class RunStartTests
var hull = MakeBoss("Boss A", 100, antagonist);
var loadout = MakeBossLoadout(hull, antagonist, "Unfittable loadout");
loadout.Slots[0].Position = new int2(999, 999);
+ loadout.Slots[1].Position = new int2(998, 998);
StoreLoadout(loadout);
Assert.Equal("Unfittable loadout", Loadouts.BossOf(_cache, antagonist, out _).Name);
@@ -598,7 +614,9 @@ public sealed partial class RunStartTests
var pack = BossZonePack(galaxy, items, galaxy.Exit, ambient: false);
Assert.False(pack.BossSpawned);
Assert.DoesNotContain(pack.Entities, entity => entity.Boss);
- Assert.Contains(log, line => line.Contains("Unfittable loadout") && line.Contains("does not fit"));
+ var refusal = Assert.Single(log, line => line.Contains("Unfittable loadout") && line.Contains("does not fit"));
+ Assert.Equal(2, Regex.Matches(refusal, "does not fit").Count);
+ Assert.Contains("; ", refusal);
Assert.False(RunGoal.ExitOpen(new Zone(items, _planetSettings, pack, galaxy.Exit, galaxy)));
}