From 7453d6a39e7544ad612f5937df3f2507d65104d3 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 13 May 2015 15:05:34 +0200 Subject: [PATCH] * Fixed the sometimes failing Spellskite Test. --- Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java | 5 ++--- .../org/mage/test/cards/triggers/SpellskiteTest.java | 10 ++++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java index b2d1733d1a..1c8d098634 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java @@ -116,8 +116,7 @@ class SpellskiteEffect extends OneShotEffect { // The source is still the spell on the stack target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); } - } - else { + } else { Player player = game.getPlayer(source.getControllerId()); for (Target target: targets) { for (UUID targetId: target.getTargets()) { @@ -147,7 +146,7 @@ class SpellskiteEffect extends OneShotEffect { } } if (oldTarget != null) { - game.informPlayers(new StringBuilder(sourceObject.getName()).append(": Changed target of ").append(stackObject.getName()).append(" from ").append(oldTarget.getName()).append(" to ").append(sourceObject.getName()).toString()); + game.informPlayers(sourceObject.getLogName() + ": Changed target of " +stackObject.getLogName() + " from " + oldTarget.getLogName() + " to " + sourceObject.getLogName()); } else { if (twoTimesTarget) { game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its not valid to target it twice for " + stackObject.getName()); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java index 679b733870..7884d15402 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java @@ -76,11 +76,12 @@ public class SpellskiteTest extends CardTestPlayerBase { * */ /** - * TODO: This test fails sometimes when building the complete Tets Project -> Find reason + * TODO: This test fails sometimes when building the complete Test Project -> Find the reason */ @Test public void testAfterChangeOfController() { - addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + // {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a multicolored spell. + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerA, "Island", 3); // {2}, {tap}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped. addCard(Zone.BATTLEFIELD, playerA, "Vedalken Shackles", 1); @@ -96,7 +97,7 @@ public class SpellskiteTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Gain control", "Spellskite"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Frost Titan"); - addTarget(playerB, "Mountain"); + addTarget(playerB, "Silvercoat Lion"); activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{UP}: Change a target", "stack ability (Whenever {this} enters "); @@ -107,7 +108,8 @@ public class SpellskiteTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Frost Titan", 1); assertTapped("Spellskite", true); - assertTapped("Mountain", false); + // (Battlefield) Tapped state is not equal (Silvercoat Lion) expected: but was: + assertTapped("Silvercoat Lion", false); }