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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-11 22:51:07 +02:00
commit 4658fa7af6

View file

@ -353,7 +353,7 @@ public sealed partial class RunStartTests : IDisposable
[Fact]
public void GenerationOffersExactlyTheSoldGearSomeHullCanFit()
{
var hulls = _cache.GetAll<HullData>().ToArray();
var hulls = LoadoutGenerator.SoldHulls(_cache);
var sold = _cache.GetAll<FactionProductData>().Where(p => p.Manufacturer.IsSet()).Select(p => p.Design.Key).ToHashSet();
var generator = PreludeGenerator();
var wrong = _cache.GetAll<EquippableItemData>()
@ -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<CraftedItemData>(_cache.RefOf(bigMount).Key), Manufacturer = _cache.RefOf(_protagonist)
});
Assert.True(Offered(generator, huge), "a hull whose hardpoint takes it gives it a home");
}