|
| 1 | +package org.mage.test.cards.single.sos; |
| 2 | + |
| 3 | +import mage.constants.PhaseStep; |
| 4 | +import mage.constants.Zone; |
| 5 | +import org.junit.Assert; |
| 6 | +import org.junit.Ignore; |
| 7 | +import org.junit.Test; |
| 8 | +import org.mage.test.player.TestPlayer; |
| 9 | +import org.mage.test.serverside.base.CardTestPlayerBase; |
| 10 | + |
| 11 | +/** |
| 12 | + * @author Susucr |
| 13 | + */ |
| 14 | +public class MoseoVeinsNewDeanTest extends CardTestPlayerBase { |
| 15 | + |
| 16 | + /** |
| 17 | + * {@link mage.cards.m.MoseoVeinsNewDean Moseo, Vein's new Dean} {2}{B} |
| 18 | + * Legendary Creature — Bird Skeleton Warlock |
| 19 | + * Flying |
| 20 | + * When Moseo enters, create a 1/1 black and green Pest creature token with “Whenever this token attacks, you gain 1 life.” |
| 21 | + * Infusion — At the beginning of your end step, if you gained life this turn, return up to one target creature card with mana value X or less from your graveyard to the battlefield, where X is the amount of life you gained this turn. |
| 22 | + * 2/1 |
| 23 | + */ |
| 24 | + private static final String moseo = "Moseo, Vein's New Dean"; |
| 25 | + |
| 26 | + @Test |
| 27 | + public void test_NoTrigger() { |
| 28 | + addCard(Zone.BATTLEFIELD, playerA, moseo, 1); |
| 29 | + addCard(Zone.GRAVEYARD, playerA, "Memnite", 1); |
| 30 | + |
| 31 | + setStopAt(2, PhaseStep.BEGIN_COMBAT); |
| 32 | + setStrictChooseMode(true); |
| 33 | + execute(); |
| 34 | + |
| 35 | + assertPermanentCount(playerA, 1); |
| 36 | + } |
| 37 | + |
| 38 | + @Test |
| 39 | + public void test_Gain5_NoValidTarget() { |
| 40 | + addCard(Zone.BATTLEFIELD, playerA, moseo, 1); |
| 41 | + addCard(Zone.GRAVEYARD, playerA, "Craw Wurm", 1); |
| 42 | + addCard(Zone.HAND, playerA, "Chaplain's Blessing"); // {W} gain 5 life |
| 43 | + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); |
| 44 | + |
| 45 | + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chaplain's Blessing"); |
| 46 | + |
| 47 | + // there is a trigger, but no valid target |
| 48 | + addTarget(playerA, TestPlayer.TARGET_SKIP); |
| 49 | + |
| 50 | + setStopAt(2, PhaseStep.BEGIN_COMBAT); |
| 51 | + setStrictChooseMode(true); |
| 52 | + |
| 53 | + execute(); |
| 54 | + assertLife(playerA, 25); |
| 55 | + assertPermanentCount(playerA, "Craw Wurm", 0); |
| 56 | + } |
| 57 | + |
| 58 | + @Ignore |
| 59 | + @Test |
| 60 | + public void test_Gain5_NoValidTarget_Attempt() { |
| 61 | + addCard(Zone.BATTLEFIELD, playerA, moseo, 1); |
| 62 | + addCard(Zone.GRAVEYARD, playerA, "Craw Wurm", 1); |
| 63 | + addCard(Zone.HAND, playerA, "Chaplain's Blessing"); // {W} gain 5 life |
| 64 | + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); |
| 65 | + |
| 66 | + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chaplain's Blessing"); |
| 67 | + |
| 68 | + // there is a trigger, but no valid target, target will not be used |
| 69 | + addTarget(playerA, "Craw Wurm"); |
| 70 | + |
| 71 | + setStopAt(2, PhaseStep.BEGIN_COMBAT); |
| 72 | + setStrictChooseMode(true); |
| 73 | + |
| 74 | + try { |
| 75 | + execute(); |
| 76 | + Assert.fail("must throw exception on execute"); |
| 77 | + } catch (Throwable e) { |
| 78 | + if (!e.getMessage().contains("Targets list was setup by addTarget with [Craw Wurm], but not used")) { |
| 79 | + Assert.fail("must have thrown error about unused target, but got:\n" + e.getMessage()); |
| 80 | + } |
| 81 | + } |
| 82 | + assertPermanentCount(playerA, "Craw Wurm", 0); |
| 83 | + } |
| 84 | + |
| 85 | + @Test |
| 86 | + public void test_Gain5_ValidTarget() { |
| 87 | + addCard(Zone.BATTLEFIELD, playerA, moseo, 1); |
| 88 | + addCard(Zone.GRAVEYARD, playerA, "Craw Wurm", 1); |
| 89 | + addCard(Zone.GRAVEYARD, playerA, "Centaur Courser", 1); |
| 90 | + addCard(Zone.GRAVEYARD, playerA, "Armored Cancrix", 1); |
| 91 | + addCard(Zone.HAND, playerA, "Chaplain's Blessing"); // {W} gain 5 life |
| 92 | + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); |
| 93 | + |
| 94 | + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chaplain's Blessing"); |
| 95 | + |
| 96 | + // target for the trigger |
| 97 | + addTarget(playerA, "Armored Cancrix"); |
| 98 | + |
| 99 | + setStopAt(2, PhaseStep.BEGIN_COMBAT); |
| 100 | + setStrictChooseMode(true); |
| 101 | + execute(); |
| 102 | + |
| 103 | + assertPermanentCount(playerA, "Craw Wurm", 0); |
| 104 | + } |
| 105 | +} |
0 commit comments