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,6 +14,11 @@ namespace SVSim.BattleEngine.Tests
|
||||
[TestFixture]
|
||||
public class FixedDamageSpellOracleTests
|
||||
{
|
||||
private TestBattleScope _scope;
|
||||
|
||||
[SetUp] public void SetUpScope() { _scope = new TestBattleScope(); }
|
||||
[TearDown] public void TearDownScope() { _scope?.Dispose(); _scope = null; }
|
||||
|
||||
// The spell's sole skill is `damage=3` to the enemy leader (cards.json skill_option for 900124030).
|
||||
private const int ExpectedLeaderDamage = 3;
|
||||
|
||||
@@ -29,9 +34,9 @@ namespace SVSim.BattleEngine.Tests
|
||||
[Test]
|
||||
public void Fixed_damage_spell_reduces_opponent_leader_life()
|
||||
{
|
||||
HeadlessEngineEnv.EnsureInitialized();
|
||||
BattleManagerBase.IsForecast = true; // suppress VFX registration (F1)
|
||||
var mgr = new SingleBattleMgr(new HeadlessContentsCreator());
|
||||
_scope.Ctx.Mgr = mgr;
|
||||
mgr.IsRecovery = true; // collapse wait delays to 0 (F1)
|
||||
|
||||
var player = mgr.BattlePlayer;
|
||||
|
||||
Reference in New Issue
Block a user