From 0fbc86be47bc3654b9fc654f581dd0264389cd0a Mon Sep 17 00:00:00 2001 From: Derek Monturo Date: Sat, 13 May 2017 12:38:07 -0400 Subject: [PATCH] adjusting tests for #3359. also consolidated kalitas test to here --- .../replacement/KalitasTraitorOfGhetTest.java | 88 ------------------- .../replacement/WouldDieExileInsteadTest.java | 46 ++++++++-- 2 files changed, 41 insertions(+), 93 deletions(-) delete mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/replacement/KalitasTraitorOfGhetTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/KalitasTraitorOfGhetTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/KalitasTraitorOfGhetTest.java deleted file mode 100644 index 427ab5bfb5..0000000000 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/KalitasTraitorOfGhetTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.mage.test.cards.replacement; - -import mage.constants.PhaseStep; -import mage.constants.Zone; -import org.junit.Test; -import org.mage.test.serverside.base.CardTestPlayerBase; - -/** - * - * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) - */ -public class KalitasTraitorOfGhetTest extends CardTestPlayerBase { - - /* - * Reported bug: Damnation with Kalitas, Traitor of Ghet on my side and 3 opponent creatures, it only exiled 1 creature giving me only 1 zombie instead of 3. - */ - @Test - public void testDamnation() { - - /* - Kalitas, Traitor of Ghet {2}{B}{B} 3/4 lifelink - Legendary Vampire - If a nontoken creature an opponent controls would die, instead exile that card and put a 2/2 black Zombie creature token onto the battlefield. - */ - addCard(Zone.BATTLEFIELD, playerA, "Kalitas, Traitor of Ghet", 1); - /* - Damnation {2}{B}{B} - Sorcery - Destroy all creatures. They can't be regenerated. - */ - addCard(Zone.HAND, playerA, "Damnation", 1); - - addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); - - addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1); - addCard(Zone.BATTLEFIELD, playerB, "Wall of Roots", 1); - addCard(Zone.BATTLEFIELD, playerB, "Sigiled Starfish", 1); - - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Damnation"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); - execute(); - - assertGraveyardCount(playerA, "Kalitas, Traitor of Ghet", 1); - assertGraveyardCount(playerA, "Damnation", 1); - assertExileCount("Bronze Sable", 1); - assertExileCount("Wall of Roots", 1); - assertExileCount("Sigiled Starfish", 1); - assertGraveyardCount(playerB, 0); // all 3 creatures of playerB should be exiled not in graveyard - assertExileCount("Kalitas, Traitor of Ghet", 0); // player controlled, not opponent so not exiled - assertPermanentCount(playerA, "Zombie", 3); // 3 tokens generated from exiling 3 opponent's creatures - } - - @Test - public void testDamnationGraveyard() { - - /* - Kalitas, Traitor of Ghet {2}{B}{B} 3/4 lifelink - Legendary Vampire - If a nontoken creature an opponent controls would die, instead exile that card and put a 2/2 black Zombie creature token onto the battlefield. - */ - addCard(Zone.GRAVEYARD, playerA, "Kalitas, Traitor of Ghet", 1); - /* - Damnation {2}{B}{B} - Sorcery - Destroy all creatures. They can't be regenerated. - */ - addCard(Zone.HAND, playerA, "Damnation", 1); - - addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); - - addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1); - addCard(Zone.BATTLEFIELD, playerB, "Wall of Roots", 1); - addCard(Zone.BATTLEFIELD, playerB, "Sigiled Starfish", 1); - - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Damnation"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); - execute(); - - assertGraveyardCount(playerA, "Kalitas, Traitor of Ghet", 1); - assertGraveyardCount(playerA, "Damnation", 1); - assertGraveyardCount(playerB, "Bronze Sable", 1); - assertGraveyardCount(playerB, "Wall of Roots", 1); - assertGraveyardCount(playerB, "Sigiled Starfish", 1); - assertPermanentCount(playerA, "Zombie", 0); // 3 tokens generated from exiling 3 opponent's creatures - } - -} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/WouldDieExileInsteadTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/WouldDieExileInsteadTest.java index 939b8d0670..396ba0c7f1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/WouldDieExileInsteadTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/WouldDieExileInsteadTest.java @@ -2,7 +2,6 @@ package org.mage.test.cards.replacement; import mage.constants.PhaseStep; import mage.constants.Zone; -import mage.game.turn.Phase; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -11,6 +10,43 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ public class WouldDieExileInsteadTest extends CardTestPlayerBase { + /* + * Reported bug: Damnation with Kalitas, Traitor of Ghet on my side and 3 opponent creatures, it only exiled 1 creature giving me only 1 zombie instead of 3. + */ + @Test + public void kalitasDamnationInteraction() { + + /* + Kalitas, Traitor of Ghet {2}{B}{B} 3/4 lifelink - Legendary Vampire + If a nontoken creature an opponent controls would die, instead exile that card and put a 2/2 black Zombie creature token onto the battlefield. + */ + addCard(Zone.BATTLEFIELD, playerA, "Kalitas, Traitor of Ghet", 1); + /* + Damnation {2}{B}{B} - Sorcery + Destroy all creatures. They can't be regenerated. + */ + addCard(Zone.HAND, playerA, "Damnation", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); + + addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1); + addCard(Zone.BATTLEFIELD, playerB, "Wall of Roots", 1); + addCard(Zone.BATTLEFIELD, playerB, "Sigiled Starfish", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Damnation"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Kalitas, Traitor of Ghet", 1); + assertGraveyardCount(playerA, "Damnation", 1); + assertExileCount("Bronze Sable", 1); + assertExileCount("Wall of Roots", 1); + assertExileCount("Sigiled Starfish", 1); + assertGraveyardCount(playerB, 0); // all 3 creatures of playerB should be exiled not in graveyard + assertExileCount("Kalitas, Traitor of Ghet", 0); // player controlled, not opponent so not exiled + assertPermanentCount(playerA, "Zombie", 3); // 3 tokens generated from exiling 3 opponent's creatures + } + /* * Reported bug #3359 (NOTE: test is failing due to bug in code) * Creature with 2 toughness targetted by Soul-Scar Mage and Magma Spray was not exiled when it died @@ -53,10 +89,10 @@ public class WouldDieExileInsteadTest extends CardTestPlayerBase { } /* - * Incendiary Flow though worded slightly differently than Magma Spray, still would exile the creature from damage dealt to it + * Incendiary Flow is worded slightly differently and would not exile here. See issue #3359 for details. */ @Test - public void incendiaryFlow_SoulScarMageEffect_ShouldExile() { + public void incendiaryFlow_SoulScarMageEffect_ShouldNotExile() { /* Soul-Scar Mage {R} @@ -89,7 +125,7 @@ public class WouldDieExileInsteadTest extends CardTestPlayerBase { assertGraveyardCount(playerA, iFlow, 1); assertPermanentCount(playerB, hGiant, 0); assertPowerToughness(playerA, ssMage, 2, 3); // prowess triggered - assertGraveyardCount(playerB, hGiant, 0); - assertExileCount(playerB, hGiant, 1); + assertGraveyardCount(playerB, hGiant, 1); + assertExileCount(playerB, hGiant, 0); } }