From 9c4aee2e923bc36713013fa54d0c3da7e186ee42 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sat, 4 Aug 2012 09:49:32 +0400 Subject: [PATCH] Failing tests for Islandwalk (Issue#35) --- .../MasterOfThePearlTridentTest.java | 105 ++++++++++++++++++ .../base/impl/CardTestPlayerAPIImpl.java | 2 +- 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/continuous/MasterOfThePearlTridentTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/MasterOfThePearlTridentTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/MasterOfThePearlTridentTest.java new file mode 100644 index 00000000000..a15fd4002a2 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/MasterOfThePearlTridentTest.java @@ -0,0 +1,105 @@ +package org.mage.test.cards.continuous; + +import mage.Constants; +import mage.abilities.keyword.IslandwalkAbility; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author magenoxx_at_gmail.com + */ +public class MasterOfThePearlTridentTest extends CardTestPlayerBase { + + @Test + public void testLordAbility() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 2); + addCard(Constants.Zone.HAND, playerA, "Master of the Pearl Trident"); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk of the Pearl Trident"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Master of the Pearl Trident"); + + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Master of the Pearl Trident", 1); + assertPowerToughness(playerA, "Merfolk of the Pearl Trident", 2, 2); + assertAbility(playerA, "Merfolk of the Pearl Trident", new IslandwalkAbility(), true); + } + + @Test + public void testLordAbilityGone() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 2); + addCard(Constants.Zone.HAND, playerA, "Master of the Pearl Trident"); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk of the Pearl Trident"); + + addCard(Constants.Zone.BATTLEFIELD, playerB, "Swamp", 3); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Llanowar Elves"); + addCard(Constants.Zone.HAND, playerB, "Murder"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Master of the Pearl Trident"); + castSpell(3, Constants.PhaseStep.DECLARE_ATTACKERS, playerB, "Murder", "Master of the Pearl Trident"); + + attack(3, playerA, "Merfolk of the Pearl Trident"); + block(3, playerB, "Llanowar Elves", "Merfolk of the Pearl Trident"); + + setStopAt(3, Constants.PhaseStep.END_TURN); + execute(); + + assertLife(playerB, 20); + assertPermanentCount(playerA, "Merfolk of the Pearl Trident", 0); + assertPermanentCount(playerB, "Llanowar Elves", 0); + } + + @Test + public void testTurnToFrog() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 2); + addCard(Constants.Zone.HAND, playerA, "Master of the Pearl Trident"); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk of the Pearl Trident"); + + addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Llanowar Elves"); + addCard(Constants.Zone.HAND, playerB, "Turn to Frog"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Master of the Pearl Trident"); + castSpell(3, Constants.PhaseStep.DECLARE_ATTACKERS, playerB, "Turn to Frog", "Master of the Pearl Trident"); + + attack(3, playerA, "Merfolk of the Pearl Trident"); + block(3, playerB, "Llanowar Elves", "Merfolk of the Pearl Trident"); + + setStopAt(3, Constants.PhaseStep.END_TURN); + execute(); + + assertLife(playerB, 20); + assertPermanentCount(playerA, "Merfolk of the Pearl Trident", 0); + assertPermanentCount(playerB, "Llanowar Elves", 0); + } + + @Test + public void testTurnToFrogAndMurder() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 2); + addCard(Constants.Zone.HAND, playerA, "Master of the Pearl Trident"); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk of the Pearl Trident"); + + addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Swamp", 3); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Llanowar Elves"); + addCard(Constants.Zone.HAND, playerB, "Turn to Frog"); + addCard(Constants.Zone.HAND, playerB, "Murder"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Master of the Pearl Trident"); + castSpell(3, Constants.PhaseStep.BEGIN_COMBAT, playerB, "Turn to Frog", "Master of the Pearl Trident"); + castSpell(3, Constants.PhaseStep.DECLARE_ATTACKERS, playerB, "Murder", "Master of the Pearl Trident"); + + attack(3, playerA, "Merfolk of the Pearl Trident"); + block(3, playerB, "Llanowar Elves", "Merfolk of the Pearl Trident"); + + setStopAt(3, Constants.PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerB, "Turn to Frog", 1); + assertGraveyardCount(playerB, "Murder", 1); + assertLife(playerB, 20); + assertPermanentCount(playerA, "Merfolk of the Pearl Trident", 0); + assertPermanentCount(playerB, "Llanowar Elves", 0); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index bcd655259b7..c1c4f35244d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -362,7 +362,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement * @param player * @param cardName * @param ability - * @param flag true if creature should contain ability, false otherwise + * @param flag true if creature should contain ability, false if it should NOT contain it instead * @throws AssertionError */ public void assertAbility(Player player, String cardName, Ability ability, boolean flag) throws AssertionError {