Tests: a partial cycle of room does not make a product wanted; the Facility-row reservation is pinned at equip time

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-28 19:33:47 +01:00
commit 24e6895913

View file

@ -57,7 +57,8 @@ public sealed class FacilityProductionTests : IDisposable
{
new HardpointData { Type = HardpointType.Facility, Position = new int2(0, 0), Shape = Solid(2, 2), Transform = "Fa.1" },
new HardpointData { Type = HardpointType.Facility, Position = new int2(2, 0), Shape = Solid(2, 2), Transform = "Fa.2" },
new HardpointData { Type = HardpointType.Facility, Position = new int2(0, 2), Shape = Solid(2, 2), Transform = "Fa.3" }
new HardpointData { Type = HardpointType.Facility, Position = new int2(0, 2), Shape = Solid(2, 2), Transform = "Fa.3" },
new HardpointData { Type = HardpointType.Facility, Position = new int2(1, 5), Shape = Solid(2, 2), Transform = "Fa.4" }
}
});
cache.Upsert(new CargoBayData { Name = "Crate", Shape = new Shape(), InteriorShape = Solid(4, 4), Price = 20, Durability = 4 });
@ -387,6 +388,7 @@ public sealed class FacilityProductionTests : IDisposable
Assert.True(cycle > 1);
Assert.True(world.Hold.TryPut(Iron, ShareOf(Iron) - cycle + 1));
Assert.Equal(cycle - 1, world.Hold.Room(Iron));
Assert.False(StationWants.CanStart(world.Station, _cache.Get<RecipeData>(RecipeData.KeyOf(Iron))));
Stock(world, IronFillers[0], 3);
Assert.Equal(Stall.Room, Production.Advance(_cache, RefineryRuns, null, 1, world.Hold).stall);
Assert.Equal(3, Held(world, IronFillers[0]));
@ -408,11 +410,11 @@ public sealed class FacilityProductionTests : IDisposable
var items = new ItemManager(1u, _cache, new ProvenanceLedger(), RunSaveTests.TestSettings(), _ => { });
var zone = new Zone(items, new PlanetSettings(), new ZonePack(), new GalaxyZone { Name = "Test Zone", Owner = null }, null);
var station = new OrbitalEntity(items, zone, Mint(items, _cache, "Test Yard"), default, new EntitySettings());
// Fa.2 is empty: a lamp is refused there, taken beside it, and the row is not free space.
Assert.False(station.TryEquip(Mint(items, _cache, "Lamp"), new int2(2, 0)));
Assert.False(station.UnoccupiedSpace[new int2(2, 0)]);
Assert.True(station.UnoccupiedSpace[new int2(5, 5)]);
Assert.True(station.TryEquip(Mint(items, _cache, "Lamp"), new int2(5, 5)));
// Fa.4 is empty and inside the hull: a lamp is refused there, taken beside it, and the row is not free space.
Assert.False(station.TryEquip(Mint(items, _cache, "Lamp"), new int2(1, 5)));
Assert.False(station.UnoccupiedSpace[new int2(1, 5)]);
Assert.True(station.UnoccupiedSpace[new int2(3, 3)]);
Assert.True(station.TryEquip(Mint(items, _cache, "Lamp"), new int2(3, 3)));
}
[Fact]