From 9803c069f94e94b2c58a2420ff78850ba945cdba Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 15 Jul 2013 19:54:37 +0200 Subject: [PATCH] Fixed and extended PlaneswalkerRuleTest. --- .../mage/test/sba/PlaneswalkerRuleTest.java | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/sba/PlaneswalkerRuleTest.java b/Mage.Tests/src/test/java/org/mage/test/sba/PlaneswalkerRuleTest.java index 44287943f6..8663276002 100644 --- a/Mage.Tests/src/test/java/org/mage/test/sba/PlaneswalkerRuleTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/sba/PlaneswalkerRuleTest.java @@ -11,10 +11,10 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class PlaneswalkerRuleTest extends CardTestPlayerBase { /** - * Check two copies of the same planeswalker will be destroyed + * Check two copies of the same planeswalker played from different players won't be destroyed */ @Test - public void testDestroySamePlaneswalkers() { + public void testDontDestroySamePlaneswalkers() { addCard(Zone.HAND, playerA, "Jace, Memory Adept"); addCard(Zone.BATTLEFIELD, playerA, "Island", 5); @@ -25,15 +25,15 @@ public class PlaneswalkerRuleTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_COMBAT); execute(); - assertPermanentCount(playerA, "Jace, Memory Adept", 0); - assertPermanentCount(playerB, "Jace, Memory Adept", 0); + assertPermanentCount(playerA, "Jace, Memory Adept", 1); + assertPermanentCount(playerB, "Jace, Memory Adept", 1); } /** - * Check two different planeswalkers but with the same subtype will be destroyed + * Check two different planeswalkers but with the same subtype played by two different players won't be destroyed */ @Test - public void testDestroySameSubtype() { + public void testDontDestroySameSubtype() { addCard(Zone.HAND, playerA, "Jace Beleren"); addCard(Zone.BATTLEFIELD, playerA, "Island", 3); @@ -44,9 +44,25 @@ public class PlaneswalkerRuleTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_COMBAT); execute(); - assertPermanentCount(playerA, "Jace Beleren", 0); - assertPermanentCount(playerB, "Jace, Memory Adept", 0); + assertPermanentCount(playerA, "Jace Beleren", 1); + assertPermanentCount(playerB, "Jace, Memory Adept", 1); } + /** + * Check two copies of the same planeswalker played from the same player that one must be sacrificed + */ + @Test + public void testDestroySamePlaneswalkers() { + addCard(Zone.HAND, playerA, "Jace, Memory Adept"); + addCard(Zone.BATTLEFIELD, playerA, "Island", 5); + addCard(Zone.BATTLEFIELD, playerA, "Jace, Memory Adept"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Jace, Memory Adept"); + + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertPermanentCount(playerA, "Jace, Memory Adept", 1); + } }