From 9f7a873e5b4c6635314d5f90ea0ef1fd78044191 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 14 Oct 2020 20:36:50 -0400 Subject: [PATCH] added test for Omnath, Locus of Rage and protection effects (closes #7133) --- .../triggers/dies/OmnathLocusOfRageTest.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/OmnathLocusOfRageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/OmnathLocusOfRageTest.java index 63bfb1557f..63969189fc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/OmnathLocusOfRageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/OmnathLocusOfRageTest.java @@ -1,7 +1,10 @@ package org.mage.test.cards.triggers.dies; +import mage.abilities.keyword.ProtectionAbility; import mage.constants.PhaseStep; import mage.constants.Zone; +import mage.game.permanent.Permanent; +import org.junit.Assert; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -66,4 +69,35 @@ public class OmnathLocusOfRageTest extends CardTestPlayerBase { assertLife(playerB, 17); } + + @Test + public void testDiesTriggeredAbilityProtection() { + addCard(Zone.BATTLEFIELD, playerA, "Omnath, Locus of Rage", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + addCard(Zone.HAND, playerB, "Doom Blade", 1); + addCard(Zone.HAND, playerB, "Stave Off", 1); + addCard(Zone.BATTLEFIELD, playerB, "Scrubland", 3); + + addTarget(playerA, "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Doom Blade", "Omnath, Locus of Rage"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, true); + setChoice(playerB, "Green"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Stave Off", "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + assertAllCommandsUsed(); + + assertPermanentCount(playerB, "Silvercoat Lion", 1); + assertGraveyardCount(playerB, "Doom Blade", 1); + assertGraveyardCount(playerB, "Stave Off", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 0); + assertGraveyardCount(playerA, "Omnath, Locus of Rage", 1); + + Permanent lion = getPermanent("Silvercoat Lion"); + Assert.assertTrue("Lion has protection from green", lion.getAbilities(currentGame).containsClass(ProtectionAbility.class)); + + assertLife(playerA, 20); + assertLife(playerB, 20); + } }