From 86a498c566bf3dcf5e253bcfb1cf3b20cc778d61 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 17 Oct 2026 02:48:47 +0200 Subject: [PATCH] RigBrandTests: a pin names its brand only; the design is the product's own Not yet run on its own; the previous commit's table named designs by hand and Cargo Bay did not match. Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/RigBrandTests.cs | 44 ++++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/RigBrandTests.cs b/tests/Aetheria.Shared.Tests/RigBrandTests.cs index 17e05a29a..901afaf71 100644 --- a/tests/Aetheria.Shared.Tests/RigBrandTests.cs +++ b/tests/Aetheria.Shared.Tests/RigBrandTests.cs @@ -11,43 +11,43 @@ public sealed partial class RunStartTests private IEnumerable FittedBrands(Entity entity, string design) => entity.Equipment.Where(item => _items.GetData(item.EquippableItem).Name == design).Select(item => ProductOf(item.EquippableItem)); - private const string Sensor = "Compact Sensor", Fca = "Fire Control Array", Missile = "Guided Missile Launcher", Cell = "Cell Blaster", Cargo = "Cargo Bay"; - - // Every product a scenario's fits name, as (design, brand). A rig whose fits name a design where a brand stood would - // draw its brand from the stage's seed; so each scenario is staged under eight seeds, and every pinned design must - // come out as exactly its brand on every ship the scenario fits. A hull that is not a fit's (a generated or bare ship) + // Every product a scenario's fits name. A rig whose fits name a design where a brand stood would draw its brand from + // the stage's seed; so each scenario is staged under eight seeds, and the design of every pinned product must come out + // as exactly that product on every ship the scenario fits. A hull that is not a fit's (a generated or bare ship) // is left out: its gear is not pinned. public static IEnumerable PinnedRigs() => new[] { - Rig(new AiFusedDiscipline(), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new Arcs(), (Missile, "GT 3K"), (Cell, "FastBlast+-"), ("Autocannon", "🫳🔫"), ("Charged Scatter Blaster", "ChargeBlast SG"), ("Light Machine Gun", "ClearPath"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new Belt(), (Missile, "GT 3K"), ("Lightning Projector", "DragOnBreath"), (Cell, "FastBlast+-"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new Crossing(), (Missile, "GT 3K"), ("Lightning Projector", "DragOnBreath"), (Cell, "FastBlast+-"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new Duel(), (Missile, "GT 3K"), (Cell, "FastBlast+-"), (Cargo, "Store-All Plus"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new FusedRounds(), ("Cluster Cannon", "DeathCluster"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new LauncherAngles(), (Missile, "GT 3K"), ("Swarm Rocket Pod", "Leonid"), (Cell, "FastBlast+-"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new LockOn(), (Missile, "GT 3K"), (Cell, "FastBlast+-"), (Cargo, "Store-All Plus"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new Pursuit(), ("Mine Launcher", "parting gift"), ("Swarm Rocket Pod", "Leonid"), (Missile, "GT 3K"), (Cell, "FastBlast+-"), (Cargo, "Store-All Plus"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new RefusedRounds(), ("Autocannon", "🫳🔫"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new StarvedReactor(), ("Light Laser", "Spectra"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), - Rig(new WeaponFeel(), ("Charged Scatter Blaster", "ChargeBlast SG"), ("Autocannon", "🫳🔫"), (Cell, "FastBlast+-"), (Sensor, "not if i see you first"), (Fca, "Panopticon Prime")), + Rig(new AiFusedDiscipline(), "not if i see you first", "Panopticon Prime"), + Rig(new Arcs(), "GT 3K", "FastBlast+-", "🫳🔫", "ChargeBlast SG", "ClearPath", "not if i see you first", "Panopticon Prime"), + Rig(new Belt(), "GT 3K", "DragOnBreath", "FastBlast+-", "not if i see you first", "Panopticon Prime"), + Rig(new Crossing(), "GT 3K", "DragOnBreath", "FastBlast+-", "not if i see you first", "Panopticon Prime"), + Rig(new Duel(), "GT 3K", "FastBlast+-", "Store-All Plus", "not if i see you first", "Panopticon Prime"), + Rig(new FusedRounds(), "DeathCluster", "not if i see you first", "Panopticon Prime"), + Rig(new LauncherAngles(), "GT 3K", "Leonid", "FastBlast+-", "not if i see you first", "Panopticon Prime"), + Rig(new LockOn(), "GT 3K", "FastBlast+-", "Store-All Plus", "not if i see you first", "Panopticon Prime"), + Rig(new Pursuit(), "parting gift", "Leonid", "GT 3K", "FastBlast+-", "Store-All Plus", "not if i see you first", "Panopticon Prime"), + Rig(new RefusedRounds(), "🫳🔫", "not if i see you first", "Panopticon Prime"), + Rig(new StarvedReactor(), "Spectra", "not if i see you first", "Panopticon Prime"), + Rig(new WeaponFeel(), "ChargeBlast SG", "🫳🔫", "FastBlast+-", "not if i see you first", "Panopticon Prime"), }; - private static object[] Rig(Scenario scenario, params (string design, string brand)[] pins) => new object[] { scenario, pins }; + private static object[] Rig(Scenario scenario, params string[] brands) => new object[] { scenario, brands }; [Theory] [MemberData(nameof(PinnedRigs))] - public void TheRigsKeepTheirBrands(Scenario scenario, (string design, string brand)[] pins) + public void TheRigsKeepTheirBrands(Scenario scenario, string[] brands) { for (uint seed = 1; seed <= 8; seed++) { var (_, _, staged, failures) = Launch(new Scripted(false, scenario.Stage, seed * 7919, scenario.Generate)); Assert.Empty(failures); var ships = staged.Entities.Append(staged.Player).Where(ship => _items.GetData(ship.Hull).Name is "Longinus" or "Smoke Test Hull"); - foreach (var (design, brand) in pins) + foreach (var brand in brands) { - var brands = ships.SelectMany(ship => FittedBrands(ship, design)).Distinct().ToArray(); - Assert.True(brands.SequenceEqual(new[] { brand }), $"{scenario.Name} seed {seed}: {design} is built as [{string.Join(", ", brands)}], not {brand}"); + var product = _items.ItemData.GetAll().Single(candidate => candidate.Name == brand); + var design = _items.ItemData.Get(product.Design).Name; + var built = ships.SelectMany(ship => FittedBrands(ship, design)).Distinct().ToArray(); + Assert.True(built.SequenceEqual(new[] { brand }), $"{scenario.Name} seed {seed}: {design} is built as [{string.Join(", ", built)}], not {brand}"); } } }