refactor(battle-node): drop old BattleSession; rename V2 -> BattleSession

Old single-WS BattleSession + its dispatch/pump/ClipAckArg tests are
obsolete after the Task 9 handler cutover. ClipAckArg overflow + boundary
coverage moved into RealParticipantTests. BattleSessionV2 renamed back
to BattleSession; the V2 suffix was a placeholder during the parallel
-build refactor.
This commit is contained in:
gamer147
2026-06-01 20:10:14 -04:00
parent 91472df6fc
commit 2d7cee38d3
8 changed files with 282 additions and 1128 deletions

View File

@@ -55,6 +55,41 @@ public class RealParticipantTests
Assert.That(p.Context, Is.SameAs(ctx));
}
[Test]
public void ClipAckArg_InRange_ReturnsArgUnchanged()
{
var result = RealParticipant.ClipAckArg(42L, NullLogger<RealParticipant>.Instance, viewerId: 1);
Assert.That(result, Is.EqualTo(42));
}
[Test]
public void ClipAckArg_AboveIntMax_ClipsToIntMaxValue()
{
var result = RealParticipant.ClipAckArg((long)int.MaxValue + 1L, NullLogger<RealParticipant>.Instance, viewerId: 1);
Assert.That(result, Is.EqualTo(int.MaxValue));
}
[Test]
public void ClipAckArg_BelowIntMin_ClipsToIntMinValue()
{
var result = RealParticipant.ClipAckArg((long)int.MinValue - 1L, NullLogger<RealParticipant>.Instance, viewerId: 1);
Assert.That(result, Is.EqualTo(int.MinValue));
}
[Test]
public void ClipAckArg_AtIntMaxBoundary_ReturnsIntMaxValue()
{
var result = RealParticipant.ClipAckArg((long)int.MaxValue, NullLogger<RealParticipant>.Instance, viewerId: 1);
Assert.That(result, Is.EqualTo(int.MaxValue));
}
[Test]
public void ClipAckArg_AtIntMinBoundary_ReturnsIntMinValue()
{
var result = RealParticipant.ClipAckArg((long)int.MinValue, NullLogger<RealParticipant>.Instance, viewerId: 1);
Assert.That(result, Is.EqualTo(int.MinValue));
}
private static MatchContext FixtureCtx() => new(
SelfDeckCardIds: Enumerable.Range(1, 30).Select(_ => 100_011_010L).ToList(),
ClassId: "1", CharaId: "1", CardMasterName: "card_master_node_10015",