From eea1aa3c520626113501e3f813535a49f78e94a3 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sun, 10 Jun 2012 15:33:51 +0400 Subject: [PATCH] Failing test for Dearly Departed --- .../cards/continuous/DearlyDepartedTest.java | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/continuous/DearlyDepartedTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DearlyDepartedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DearlyDepartedTest.java new file mode 100644 index 00000000000..fc85daab4d4 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DearlyDepartedTest.java @@ -0,0 +1,66 @@ +package org.mage.test.cards.continuous; + +import mage.Constants; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author noxx + */ +public class DearlyDepartedTest extends CardTestPlayerBase { + + /** + * Tests that Dearly Departed doesn't give counter while being in hand + */ + @Test + public void testDoesntWorkFromHand() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Constants.Zone.HAND, playerA, "Elite Vanguard"); + addCard(Constants.Zone.HAND, playerA, "Dearly Departed"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Vanguard"); + + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Elite Vanguard", 1); + assertPowerToughness(playerA, "Elite Vanguard", 2, 1); + } + + /** + * Tests works in owner's graveyard + */ + @Test + public void testInGraveyard() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Constants.Zone.HAND, playerA, "Elite Vanguard"); + addCard(Constants.Zone.GRAVEYARD, playerA, "Dearly Departed"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Vanguard"); + + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Elite Vanguard", 1); + assertPowerToughness(playerA, "Elite Vanguard", 3, 2); + } + + /** + * Tests doesn't work in opponent's graveyard + */ + @Test + public void testInOpponentGraveyard() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Constants.Zone.HAND, playerA, "Elite Vanguard"); + addCard(Constants.Zone.GRAVEYARD, playerB, "Dearly Departed"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Vanguard"); + + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Elite Vanguard", 1); + assertPowerToughness(playerA, "Elite Vanguard", 2, 1); + } + +} \ No newline at end of file