From 0fe45517da3ecbd1cff7d132d362706983611ac0 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Sat, 6 Jun 2026 10:57:39 -0400 Subject: [PATCH] test(rng-seam): reset IsRandomDraw in RandomDrawOracleTests teardown (avoid cross-fixture leak) --- SVSim.BattleEngine.Tests/RandomDrawOracleTests.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SVSim.BattleEngine.Tests/RandomDrawOracleTests.cs b/SVSim.BattleEngine.Tests/RandomDrawOracleTests.cs index d1bacd9..b6ac8d6 100644 --- a/SVSim.BattleEngine.Tests/RandomDrawOracleTests.cs +++ b/SVSim.BattleEngine.Tests/RandomDrawOracleTests.cs @@ -16,6 +16,15 @@ namespace SVSim.BattleEngine.Tests [TestFixture] public class RandomDrawOracleTests { + [TearDown] + public void ResetRandomDrawGate() + { + // NewAuthoritativeBattle sets the process-global BattleManagerBase.IsRandomDraw = true; reset it + // so this fixture doesn't leak that state into later-running fixtures (which expect the default + // false / top-of-deck draw behavior). Prevents order-dependent flakes as more RNG oracles land. + BattleManagerBase.IsRandomDraw = false; + } + // Draw with a single scripted unit; return (drawnCardId, deckCountAfter). The deck is seeded with // three distinguishable cards at indices 2,3,4 -> Index-order positions 0,1,2 map to // RngDeckCardA/B/C. The draw makes one StableRandom(3) call -> index = floor(3*unit).