Test for Unearth bug added

This commit is contained in:
drmDev 2016-04-27 09:56:01 -04:00
parent 47674121fe
commit 1f1eddc65e
2 changed files with 31 additions and 4 deletions

View file

@ -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}")));
}

View file

@ -75,4 +75,28 @@ public class UnearthTest extends CardTestPlayerBase {
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);
}
}