diff --git a/SVSim.BattleEngine.Tests/EmitPathReadOracleTests.cs b/SVSim.BattleEngine.Tests/EmitPathReadOracleTests.cs index 09a123f..7bf5b05 100644 --- a/SVSim.BattleEngine.Tests/EmitPathReadOracleTests.cs +++ b/SVSim.BattleEngine.Tests/EmitPathReadOracleTests.cs @@ -57,6 +57,17 @@ namespace SVSim.BattleEngine.Tests Assert.That(player.CemeteryList, Does.Contain(spell), "spell should land in the cemetery"); Assert.That(player.ClassAndInPlayCardList, Does.Not.Contain(spell), "a spell does not occupy the board"); }); + + // Best-effort (F-E-7): with CurrentMatchingStatus seeded non-Disconnected (NewNetworkEmitBattle), + // the flow reaches stockEmitMessageMgr.StockData(info); read it back. If the stock machinery is + // not drivable headless this milestone, this assertion is DEFERRED to structural validation + // (spec §6) — the OnEmit + no-throw + state checks above are the decisive O1 read on their own. + var agent = Wizard.ToolboxGame.RealTimeNetworkAgent; + var stocked = HeadlessEngineEnv.TryReadStockedEmitData(agent); // returns null if unreachable + if (stocked != null) + Assert.That(stocked, Is.Not.Empty, "the emitted dict should be stocked non-empty"); + else + Assert.Inconclusive("payload-presence DEFERRED: stock-sequencer not drivable headless (spec §6)"); } } } diff --git a/SVSim.BattleEngine.Tests/HeadlessFixture.cs b/SVSim.BattleEngine.Tests/HeadlessFixture.cs index a285d3c..5a41723 100644 --- a/SVSim.BattleEngine.Tests/HeadlessFixture.cs +++ b/SVSim.BattleEngine.Tests/HeadlessFixture.cs @@ -434,6 +434,26 @@ namespace SVSim.BattleEngine.Tests return (mgr, emitted); } + // M13 Task 4 best-effort: read the emit payload back out of the agent's stock sequencer. With + // _notEmit=true (NewNetworkEmitBattle terminates the path that way), EmitMsgUriPack short-circuits + // BEFORE stockEmitMessageMgr.StockData (RealTimeNetworkAgent.cs:1438 vs :1461), so the stock is + // expected to be null/empty — return null on any null/throw so the test degrades to Inconclusive + // rather than failing. Field `stockEmitMessageMgr` (:103) + `GetSequenceAllData()` + // (StockEmitMgr.cs:81, returns List>) verified against the copied engine. + public static System.Collections.IList TryReadStockedEmitData(RealTimeNetworkAgent agent) + { + try + { + var f = typeof(RealTimeNetworkAgent).GetField("stockEmitMessageMgr", + System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); + var stock = f?.GetValue(agent); + if (stock == null) return null; + var m = stock.GetType().GetMethod("GetSequenceAllData"); + return m?.Invoke(stock, null) as System.Collections.IList; + } + catch { return null; } + } + private static void SetField(object obj, string name, object value) { var f = obj.GetType().GetField(name,