From 71a0d15fafb55cd69ec8e81be9e472876de55e03 Mon Sep 17 00:00:00 2001 From: drmDev Date: Thu, 31 Mar 2016 13:56:00 -0400 Subject: [PATCH] Thing in the Ice test for reported bug --- .../shadowsoverinnistrad/ThingInTheIce.java | 2 +- .../cards/single/soi/ThingInTheIceTest.java | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/soi/ThingInTheIceTest.java diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ThingInTheIce.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ThingInTheIce.java index 1ba63cf46b1..6f5f5dee27d 100644 --- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ThingInTheIce.java +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ThingInTheIce.java @@ -115,7 +115,7 @@ public class ThingInTheIce extends CardImpl { class AwokenHorrorAbility extends TriggeredAbilityImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblue creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Horror creatures"); static { filter.add(Predicates.not(new SubtypePredicate("Horror"))); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/ThingInTheIceTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/ThingInTheIceTest.java new file mode 100644 index 00000000000..cb37349f42f --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/ThingInTheIceTest.java @@ -0,0 +1,51 @@ +package org.mage.test.cards.single.soi; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + *Defender + +Thing in the Ice enters the battlefield with four ice counters on it. + +Whenever you cast an instant or sorcery spell, remove an ice counter from Thing in the Ice. Then if it has no ice counters on it, transform it. +When this creature transforms into Awoken Horror, return all non-Horror creatures to their owners' hands. + * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) + */ +public class ThingInTheIceTest extends CardTestPlayerBase { + + /** + * Reported bug: When Thing in the Ice transforms, it bounces Clue tokens. + **/ + @Test + public void testClueTokens() { + + addCard(Zone.BATTLEFIELD, playerA, "Tireless Tracker", 1); + addCard(Zone.HAND, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerB, "Thing in the Ice", 1); + addCard(Zone.HAND, playerB, "Expedite", 4); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 4); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest"); // creates a clue + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Expedite"); + addTarget(playerB, "Thing in the Ice"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Expedite"); + addTarget(playerB, "Thing in the Ice"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Expedite"); + addTarget(playerB, "Thing in the Ice"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Expedite"); + addTarget(playerB, "Thing in the Ice"); // remove all 4 ice counters to transform it + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Clue", 1); + assertHandCount(playerA, "Tireless Tracker", 1); // returned to hand + assertPermanentCount(playerA, "Tireless Tracker", 0); + assertPermanentCount(playerB, "Awoken Horror", 1); // transformed + assertGraveyardCount(playerB, "Expedite", 4); + } +}