Files
SVSimServer/SVSim.UnitTests/BattleNode/Sessions/Participants/NoOpBotParticipantTests.cs
gamer147 ba18790156 refactor(battle-node): rename ScriptedLifecycle->ServerBattleFrames, ScriptedProfiles->BattleFrameDefaults
Pure rename. These hold the shared server-authored frame builders used by every
battle mode's handshake/mulligan dispatch — the 'Scripted' name was a historical
accident that hid the PvP/Bot crossover. No behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 20:36:32 -04:00

45 lines
1.3 KiB
C#

using NUnit.Framework;
using SVSim.BattleNode.Bridge;
using SVSim.BattleNode.Protocol;
using SVSim.BattleNode.Protocol.Bodies;
using SVSim.BattleNode.Sessions;
using SVSim.BattleNode.Sessions.Participants;
namespace SVSim.UnitTests.BattleNode.Sessions.Participants;
[TestFixture]
public class NoOpBotParticipantTests
{
[Test]
public void PushAsync_swallows_without_firing_FrameEmitted()
{
var p = new NoOpBotParticipant();
var fired = 0;
p.FrameEmitted += (_, _) => { fired++; return Task.CompletedTask; };
var env = new MsgEnvelope(
NetworkBattleUri.TurnEnd, ViewerId: 1, Uuid: "u", Bid: null, Try: 0,
Cat: EmitCategory.Battle, PubSeq: null, PlaySeq: null,
Body: new ResultCodeOnlyBody());
Assert.DoesNotThrowAsync(() => p.PushAsync(env, noStock: false, CancellationToken.None));
Assert.That(fired, Is.EqualTo(0));
}
[Test]
public async Task RunAsync_returns_immediately()
{
var p = new NoOpBotParticipant();
await p.RunAsync(CancellationToken.None);
// If we got here, it returned.
Assert.Pass();
}
[Test]
public void ViewerId_is_FakeOpponent()
{
var p = new NoOpBotParticipant();
Assert.That(p.ViewerId, Is.EqualTo(SVSim.BattleNode.Lifecycle.ServerBattleFrames.FakeOpponentViewerId));
}
}