From 1f1eddc65e4685da1ce67f3e63d69e3cefd2d726 Mon Sep 17 00:00:00 2001 From: drmDev Date: Wed, 27 Apr 2016 09:56:01 -0400 Subject: [PATCH] Test for Unearth bug added --- .../mage/sets/shardsofalara/UndeadLeotau.java | 11 +++++---- .../cards/abilities/keywords/UnearthTest.java | 24 +++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/shardsofalara/UndeadLeotau.java b/Mage.Sets/src/mage/sets/shardsofalara/UndeadLeotau.java index 55960124af..2e75f617a0 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/UndeadLeotau.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/UndeadLeotau.java @@ -29,16 +29,16 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.UnearthAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; /** * @@ -54,6 +54,9 @@ public class UndeadLeotau extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(4); + + // {R}: Undead Leotau gets +1/-1 until end of turn. + // Unearth {2}{B} this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(+1, -1, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); this.addAbility(new UnearthAbility(new ManaCostsImpl("{2}{B}"))); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UnearthTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UnearthTest.java index f765abb880..c25fa594fe 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UnearthTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UnearthTest.java @@ -74,5 +74,29 @@ public class UnearthTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Hellspark Elemental", 0); assertExileCount("Hellspark Elemental", 1); } + + /** + * Reported bug: Cards with unearth (e.g. Undead Leotau) are currently bugged. When you bring a creature back from the graveyard + * with unearth, it [should] get exiled at end of turn normally, [but instead] a copy of the card stays on the battlefield + * under your control permanently. + */ + @Test + public void testUndeadLeotau() { + + //{R}: Undead Leotau gets +1/-1 until end of turn. + // Unearth {2}{B} + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); + addCard(Zone.GRAVEYARD, playerA, "Undead Leotau", 1); // 3/4 + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unearth"); + attack(1, playerA, "Undead Leotau"); + + setStopAt(2, PhaseStep.UNTAP); + execute(); + assertGraveyardCount(playerA, "Undead Leotau", 0); + assertLife(playerB, 17); + + assertPermanentCount(playerA, "Undead Leotau", 0); + assertExileCount("Undead Leotau", 1); + } } \ No newline at end of file