From cd354bacc3259c49e9a2d3703989f5a4c0ab9e5e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 15 Jul 2015 17:24:18 +0200 Subject: [PATCH] Added a test. --- .../abilities/keywords/DeathtouchTest.java | 83 ++++++++++++++----- 1 file changed, 60 insertions(+), 23 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java index 72766b529a..1f9a2f19cf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java @@ -37,32 +37,31 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author LevelX2 */ public class DeathtouchTest extends CardTestPlayerBase { - + @Test public void simpleDeathtouchDuringCombat() { addCard(Zone.BATTLEFIELD, playerA, "Archangel of Thune"); // Creature - Rat 1/1 // Deathtouch addCard(Zone.BATTLEFIELD, playerB, "Typhoid Rats"); - - + attack(2, playerB, "Typhoid Rats"); block(2, playerA, "Archangel of Thune", "Typhoid Rats"); - + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); execute(); - + assertLife(playerA, 23); assertLife(playerB, 20); - + assertGraveyardCount(playerA, "Archangel of Thune", 1); assertGraveyardCount(playerB, "Typhoid Rats", 1); } - + /** - * Checks if a creature getting damage from Marath abilitity dies - * from Deathtouch, if Marath is equiped with Deathtouch giving Equipment - * and Marath dies from removing the +1/+1 counters. + * Checks if a creature getting damage from Marath abilitity dies from + * Deathtouch, if Marath is equiped with Deathtouch giving Equipment and + * Marath dies from removing the +1/+1 counters. */ @Test public void testMarathWillOfTheWild() { @@ -73,21 +72,20 @@ public class DeathtouchTest extends CardTestPlayerBase { // Equipped creature has deathtouch and lifelink. addCard(Zone.BATTLEFIELD, playerA, "Basilisk Collar"); /* - {R}{G}{W} Legendary Creature - Elemental Beast - Marath, Will of the Wild enters the battlefield with a number of +1/+1 counters on - it equal to the amount of mana spent to cast it. - {X}, Remove X +1/+1 counters from Marath: Choose one - - * Put X +1/+1 counters on target creature - * Marath deals X damage to target creature or player - * Put an X/X green Elemental creature token onto the battlefield. X can't be 0 - */ + {R}{G}{W} Legendary Creature - Elemental Beast + Marath, Will of the Wild enters the battlefield with a number of +1/+1 counters on + it equal to the amount of mana spent to cast it. + {X}, Remove X +1/+1 counters from Marath: Choose one - + * Put X +1/+1 counters on target creature + * Marath deals X damage to target creature or player + * Put an X/X green Elemental creature token onto the battlefield. X can't be 0 + */ addCard(Zone.HAND, playerA, "Marath, Will of the Wild", 1); - + addCard(Zone.BATTLEFIELD, playerB, "Archangel of Thune"); - - castSpell(1, PhaseStep.PRECOMBAT_MAIN , playerA, "Marath, Will of the Wild"); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Marath, Will of the Wild"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", "Marath, Will of the Wild"); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{X},Remove X +1/+1 counters from Marath", "Archangel of Thune"); @@ -104,6 +102,45 @@ public class DeathtouchTest extends CardTestPlayerBase { assertLife(playerB, 20); } - + @Test + public void testMarathWillOfTheWildEleshNorn() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain"); + addCard(Zone.BATTLEFIELD, playerA, "Forest"); + addCard(Zone.BATTLEFIELD, playerA, "Plains"); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10); + + // Equipped creature has deathtouch and lifelink. + addCard(Zone.BATTLEFIELD, playerA, "Basilisk Collar"); + /* + {R}{G}{W} Legendary Creature - Elemental Beast + Marath, Will of the Wild enters the battlefield with a number of +1/+1 counters on + it equal to the amount of mana spent to cast it. + {X}, Remove X +1/+1 counters from Marath: Choose one - + * Put X +1/+1 counters on target creature + * Marath deals X damage to target creature or player + * Put an X/X green Elemental creature token onto the battlefield. X can't be 0 + */ + addCard(Zone.HAND, playerA, "Marath, Will of the Wild", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Elesh Norn, Grand Cenobite"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Marath, Will of the Wild"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", "Marath, Will of the Wild"); + + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{X},Remove X +1/+1 counters from Marath", "Elesh Norn, Grand Cenobite"); + setModeChoice(playerA, "2"); // Marath deals X damage to target creature or player + setChoice(playerA, "X=1"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Marath, Will of the Wild", 0); // died because he's 0/0 + assertPermanentCount(playerB, "Elesh Norn, Grand Cenobite", 0); // died from deathtouch + + assertLife(playerA, 21); // +1 from lifelink doing 1 damage with Marath to Elesh Norn + assertLife(playerB, 20); + + } }