feat(battle-node): client-shaped handshake builders for the scripted bot
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -166,6 +166,27 @@ public class ScriptedLifecycleTests
|
||||
"single-arg overload (non-interactive opponent) keeps the placeholder hand.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BuildClientSwap_has_empty_idxList_in_RawBody()
|
||||
{
|
||||
var env = ScriptedLifecycle.BuildClientSwap();
|
||||
Assert.That(env.Uri, Is.EqualTo(NetworkBattleUri.Swap));
|
||||
Assert.That(env.ViewerId, Is.EqualTo(ScriptedLifecycle.FakeOpponentViewerId));
|
||||
|
||||
var raw = (RawBody)env.Body;
|
||||
Assert.That(raw.Entries.ContainsKey("idxList"), Is.True);
|
||||
var idx = (System.Collections.IEnumerable)raw.Entries["idxList"]!;
|
||||
Assert.That(idx.Cast<object>().Count(), Is.EqualTo(0), "bot keeps its dealt hand (empty mulligan).");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BuildClientHandshakeFrames_carry_expected_uris()
|
||||
{
|
||||
Assert.That(ScriptedLifecycle.BuildClientInitNetwork().Uri, Is.EqualTo(NetworkBattleUri.InitNetwork));
|
||||
Assert.That(ScriptedLifecycle.BuildClientInitBattle().Uri, Is.EqualTo(NetworkBattleUri.InitBattle));
|
||||
Assert.That(ScriptedLifecycle.BuildClientLoaded().Uri, Is.EqualTo(NetworkBattleUri.Loaded));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BuildOpponentTurnStart_HasUriTurnStartAndSpin()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user