using NUnit.Framework; using ProjectM.Simulation; namespace ProjectM.Tests { /// /// Pure-function tests for (no ECS world), mirroring PlayerSpawnRingTests / /// EnemyAIMathTests. Pins the deterministic player respawn-timer math. /// public class RespawnMathTests { [Test] public void RespawnTick_AddsDelay() { Assert.AreEqual(1180u, RespawnMath.RespawnTick(1000u, 180)); } [Test] public void RespawnTick_ClampsDelayToAtLeastOne() { Assert.AreEqual(1001u, RespawnMath.RespawnTick(1000u, 0)); Assert.AreEqual(1001u, RespawnMath.RespawnTick(1000u, -5)); } [Test] public void RespawnTick_NeverReturnsZeroSentinel() { // A death exactly at tick 0 must still schedule a non-zero recovery tick. Assert.AreNotEqual(0u, RespawnMath.RespawnTick(0u, 1)); } [Test] public void IsDue_FalseBefore_TrueAtOrAfter() { Assert.IsFalse(RespawnMath.IsDue(1100u, 1180u)); Assert.IsTrue(RespawnMath.IsDue(1180u, 1180u)); Assert.IsTrue(RespawnMath.IsDue(1200u, 1180u)); } [Test] public void IsDue_FalseWhenNoneScheduled() { Assert.IsFalse(RespawnMath.IsDue(99999u, 0u)); } } }