diff --git a/server/tests/Vanguard.Rules.Tests/GameEngineTests.cs b/server/tests/Vanguard.Rules.Tests/GameEngineTests.cs index 4f39d36..4ae6494 100644 --- a/server/tests/Vanguard.Rules.Tests/GameEngineTests.cs +++ b/server/tests/Vanguard.Rules.Tests/GameEngineTests.cs @@ -608,6 +608,22 @@ public class GameEngineTests Assert.Equal(14000, engine.EffectivePower(alfred)); } + [Fact] + public void Guard_Protects_RearGuard_From_Retirement() + { + var engine = ReadyToAttackRearGuard(); + Give(engine, 1, Barcgal); + + Assert.True(engine.Execute(new AttackCommand(3, 0)).Accepted); + Assert.True(engine.Execute(new GuardCommand(Barcgal)).Accepted); + Assert.True(engine.Execute(new PassGuardCommand()).Accepted); + + var defender = engine.State.Players[1]; + Assert.NotNull(defender.RearGuards[0]); + Assert.Contains(defender.Drop, c => c.PrintingId == Barcgal); + Assert.DoesNotContain(engine.Events, e => e is UnitRetiredEvent); + } + [Fact] public void ResolveTrigger_Rejects_When_Nothing_Is_Pending() {