From 01ccb32b89a977ee445e2466d0121d7cc43461c5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 13 Oct 2026 21:37:23 +0200 Subject: [PATCH] EW 2 fix: the worn-gun fixture reads its live range after the gun has ticked in the test's own path The previous commit ticked before firing and the gun never lit; the wear is attached, the gun fires, then the live range is asserted. Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/ClaimTests.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ClaimTests.cs b/tests/Aetheria.Shared.Tests/ClaimTests.cs index baee59f12..ab0189de6 100644 --- a/tests/Aetheria.Shared.Tests/ClaimTests.cs +++ b/tests/Aetheria.Shared.Tests/ClaimTests.cs @@ -292,15 +292,17 @@ public sealed partial class ContactRevealTests // ---- The schematic's rows (ruling ew-claim-weapon-measure-ruled; finding schematic-unreached) ---- - // Wears a gun's Range to half so its live range (20) is not its design's rated range (40); the fixture's own guard. + // Wears a gun's Range to half so that, once it ticks, its live range (20) is not its design's rated range (40). private void WearRange(Entity ship, EquippedItem gun) { var data = (InstantWeaponData) gun.Data.Behaviors.Single(b => b is InstantWeaponData); ship.Resolver.AttachModifier(gun, data.Range, "worn", StatModifierType.Multiplier, .5f); - Tick(.1f); - Assert.Equal(20f, gun.Behaviors.OfType().Single().Range, 3); } + // The fixture's guard, read once the gun has ticked: its live range is not its design's rated range. + private static void AssertWorn(EquippedItem gun) => + Assert.Equal(20f, gun.Behaviors.OfType().Single().Range, 3); + // The unclaimed enemy row is the true gun, with the gun's own rated range (Gun: 40) though the gun is worn to a live // 20. Mutation: the row's Item.Data or the true live range stands in for the claim (also when Claimed == Data). [Fact] @@ -311,6 +313,7 @@ public sealed partial class ContactRevealTests var gun = Guns(e)[0]; WearRange(e, gun); Fire(e, gun); + AssertWorn(gun); var row = Assert.Single(o.SchematicRows(e)); Assert.Same(gun, row.Item); @@ -370,6 +373,8 @@ public sealed partial class ContactRevealTests var gun = Guns(e)[0]; WearRange(e, gun); e.Claim(gun, DataOf("SpanGun")); + Tick(.1f); + AssertWorn(gun); var row = Assert.Single(e.SchematicRows(e)); Assert.Same(gun, row.Item);