From 0c5a46f776165461093d021d453404d9f07e67f0 Mon Sep 17 00:00:00 2001 From: soul Date: Sun, 29 Nov 2026 06:10:50 +0100 Subject: [PATCH] Tests: the cramped and tiny stations carry the Facility row the quarters now need before their dock and heater faults Co-Authored-By: Claude Sonnet 5.5 --- tests/Aetheria.Shared.Tests/RunStartTests.cs | 12 ++++++++++-- tests/Aetheria.Shared.Tests/StationPackageTests.cs | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/RunStartTests.cs b/tests/Aetheria.Shared.Tests/RunStartTests.cs index 92da56ce2..da3874527 100644 --- a/tests/Aetheria.Shared.Tests/RunStartTests.cs +++ b/tests/Aetheria.Shared.Tests/RunStartTests.cs @@ -327,12 +327,20 @@ public sealed partial class RunStartTests : IDisposable var sold = _cache.GetAll().Select(product => product.Design.Key).ToHashSet(); var bay = _cache.GetAll().Where(design => sold.Contains(_cache.RefOf(design).Key)) .OrderBy(design => design.Shape.Coordinates.Length).ThenBy(design => design.Name, StringComparer.Ordinal).First(); - var shape = new Shape(bay.Shape.Width + 2, bay.Shape.Height + 2); + // Three columns wider than the bay's interior, for the Crew Quarters' Facility row at the right edge: the columns the bay leaves are too + // narrow for a heater. + var shape = new Shape(bay.Shape.Width + 5, bay.Shape.Height + 2); foreach (var cell in shape.AllCoordinates) shape[cell] = true; // A kind with no facilities: the shipped trade hub now seats a silo, which a hull this small has no Facility row for. var bare = new CultRecordRef(StationKindData.KeyOf("cramped")); _cache.Commit(batch => batch.Upsert(typeof(StationKindData), new StationKindData { Name = "Cramped" }, bare.Key)); - var cramped = new HullData { Name = "Cramped Station", HullType = HullType.Station, Kind = bare, Shape = shape, Durability = 100, Mass = 1000, Price = 1 }; + var row = new Shape(2, 2); + foreach (var cell in row.AllCoordinates) row[cell] = true; + var cramped = new HullData + { + Name = "Cramped Station", HullType = HullType.Station, Kind = bare, Shape = shape, Durability = 100, Mass = 1000, Price = 1, + Hardpoints = { new HardpointData { Type = HardpointType.Facility, Position = new CultMath.int2(shape.Width - 2, 0), Shape = row, Transform = "Fa.1" } } + }; _cache.Upsert(cramped); _cache.Upsert(new FactionProductData { diff --git a/tests/Aetheria.Shared.Tests/StationPackageTests.cs b/tests/Aetheria.Shared.Tests/StationPackageTests.cs index 19086b960..174af6964 100644 --- a/tests/Aetheria.Shared.Tests/StationPackageTests.cs +++ b/tests/Aetheria.Shared.Tests/StationPackageTests.cs @@ -133,6 +133,10 @@ public sealed class StationPackageTests : IDisposable tiny.Shape = new Shape(3, 3); foreach (var cell in tiny.Shape.AllCoordinates) tiny.Shape[cell] = true; tiny.Hardpoints.Clear(); + var row = new Shape(2, 2); + foreach (var cell in row.AllCoordinates) row[cell] = true; + // The one Facility row a depot's facilities and quarters ask for: the fault under test is the docking bay, which comes after them. + tiny.Hardpoints.Add(new HardpointData { Type = HardpointType.Facility, Position = new CultMath.int2(1, 0), Shape = row, Transform = "Fa.1" }); var tinyRef = cache.Upsert(tiny); var tinyProduct = MessagePackSerializer.Deserialize(MessagePackSerializer.Serialize(depotProduct, options), options); tinyProduct.Name = "Tiny Depot";