From 4658fa7af6ce38f9f4bc5b472a805ad29e1a5fe4 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 11 Oct 2026 22:51:07 +0200 Subject: [PATCH] RunStartTests: the offered-gear checks read the hulls a product sells GenerationOffersExactlyTheSoldGearSomeHullCanFit compares against LoadoutGenerator.SoldHulls; GearNoHullCanFitIsOfferedOnlyOnceAHullTakesIt gives its scratch hull a product, since a hull no product sells is no home. The previous commit (2a943370) left both red (found by the full run); this one is the head. Commit 2a943370 does not pass the full suite. Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/RunStartTests.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/RunStartTests.cs b/tests/Aetheria.Shared.Tests/RunStartTests.cs index 2b5ae2d4d..5edaa035b 100644 --- a/tests/Aetheria.Shared.Tests/RunStartTests.cs +++ b/tests/Aetheria.Shared.Tests/RunStartTests.cs @@ -353,7 +353,7 @@ public sealed partial class RunStartTests : IDisposable [Fact] public void GenerationOffersExactlyTheSoldGearSomeHullCanFit() { - var hulls = _cache.GetAll().ToArray(); + var hulls = LoadoutGenerator.SoldHulls(_cache); var sold = _cache.GetAll().Where(p => p.Manufacturer.IsSet()).Select(p => p.Design.Key).ToHashSet(); var generator = PreludeGenerator(); var wrong = _cache.GetAll() @@ -366,7 +366,7 @@ public sealed partial class RunStartTests : IDisposable "the Autocannon fits the turret's 8-cell Ballistic hardpoint, so it is offered"); } - // Gear no hull can fit is never offered; authoring a hull whose hardpoint takes it makes it offered. + // Gear no sold hull can fit is never offered; a product selling a hull whose hardpoint takes it makes it offered. [Fact] public void GearNoHullCanFitIsOfferedOnlyOnceAHullTakesIt() { @@ -378,10 +378,15 @@ public sealed partial class RunStartTests : IDisposable foreach (var cell in shape.AllCoordinates) shape[cell] = true; var hardpointShape = new Shape(8, 8); foreach (var cell in hardpointShape.AllCoordinates) hardpointShape[cell] = true; - _cache.Upsert(new HullData + var bigMount = new HullData { Name = "Big Mount", HullType = HullType.Ship, Shape = shape, Durability = 100, Mass = 1000, Price = 1, Hardpoints = { new HardpointData { Type = HardpointType.Ballistic, Position = int2(0, 0), Shape = hardpointShape } } + }; + _cache.Upsert(bigMount); + _cache.Upsert(new FactionProductData + { + Name = "Big Mount", Design = new CultRecordRef(_cache.RefOf(bigMount).Key), Manufacturer = _cache.RefOf(_protagonist) }); Assert.True(Offered(generator, huge), "a hull whose hardpoint takes it gives it a home"); }