34 lines
1.5 KiB
C#
34 lines
1.5 KiB
C#
using NUnit.Framework;
|
|
|
|
namespace SVSim.UnitTests.BattleNode.Integration;
|
|
|
|
/// <summary>
|
|
/// Headless-Conductor milestone tests (M-HC-*). The oracle is a node-native battle:
|
|
/// a FIXED master seed + FIXED decks drive the engine's receive path headless, and we
|
|
/// assert on engine board-state. By construction the node assigns idx = position in the
|
|
/// shuffled order, so the engine's headless draw reproduces the node's draw order.
|
|
///
|
|
/// Task 1 (M-HC-0a) exit criterion: the engine seats headless (IsReady) in the
|
|
/// SVSim.UnitTests process.
|
|
/// </summary>
|
|
[TestFixture]
|
|
public class HeadlessConductorTests
|
|
{
|
|
[Test]
|
|
public void Harness_seats_engine_headless_and_is_ready()
|
|
{
|
|
using var harness = NodeNativeBattleHarness.Create();
|
|
|
|
Assert.That(harness.IsReady, Is.True,
|
|
"Engine must seat headless: EngineGlobalInit ran + both decks seeded. " +
|
|
"If false, the most likely cause is a missing cards.json content link in " +
|
|
"SVSim.UnitTests.csproj (EngineGlobalInit reads AppContext.BaseDirectory/Data/cards.json).");
|
|
|
|
// Non-vacuous: a seated engine has live board state for BOTH seats. Reading these off a
|
|
// not-really-set-up engine would throw (Seat() guards on _mgr). Leader life is the headless
|
|
// default (20) before any frame is ingested.
|
|
Assert.That(harness.LeaderLife(playerSeat: true), Is.EqualTo(20), "seat A leader life");
|
|
Assert.That(harness.LeaderLife(playerSeat: false), Is.EqualTo(20), "seat B leader life");
|
|
}
|
|
}
|