test(engine-ambient): TestBattleScope + HeadlessFixture split for multi-instance
Step 6 of multi-instancing migration. HeadlessEngineEnv.EnsureInitialized is split into EnsureProcessGlobals (idempotent, process-once) + SeedCharaIdsOnCurrentAmbient (per-test). New TestBattleScope IDisposable sets up a fresh BattleAmbientContext per test. NonParallelizable removed from converted classes; assembly-level Parallelizable(Fixtures) enabled. SVSim.BattleEngine.Tests fully green under parallel test execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -14,12 +14,17 @@ namespace SVSim.BattleEngine.Tests
|
||||
[TestFixture]
|
||||
public class ConstructionProbeTests
|
||||
{
|
||||
private TestBattleScope _scope;
|
||||
|
||||
[SetUp] public void SetUpScope() { _scope = new TestBattleScope(); }
|
||||
[TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; }
|
||||
|
||||
[Test]
|
||||
public void SingleBattleMgr_constructs_headless()
|
||||
{
|
||||
// Mirror the forecast flags the design pins (DP4 / §3): suppress VFX registration and
|
||||
// collapse wait delays. Set before construction so any ctor-time VFX path no-ops.
|
||||
HeadlessEngineEnv.EnsureInitialized();
|
||||
// collapse wait delays. TestBattleScope already sets ctx.IsForecast=true; this line is a
|
||||
// belt-and-suspenders write through the ambient setter.
|
||||
BattleManagerBase.IsForecast = true;
|
||||
|
||||
SingleBattleMgr mgr = null;
|
||||
@@ -37,6 +42,7 @@ namespace SVSim.BattleEngine.Tests
|
||||
Assert.That(mgr, Is.Not.Null);
|
||||
Assert.That(mgr.BattlePlayer, Is.Not.Null, "BattlePlayer (self) not created");
|
||||
Assert.That(mgr.BattleEnemy, Is.Not.Null, "BattleEnemy (opponent) not created");
|
||||
_scope.Ctx.Mgr = mgr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user