[CMR] fixed Rakshasa Debaser - class cast exception in filter on usage;

This commit is contained in:
Oleg Agafonov 2020-12-18 15:54:59 +04:00
parent d39575c24e
commit c13d07b73d
8 changed files with 62 additions and 88 deletions

View file

@ -1,4 +1,3 @@
package org.mage.test.cards.copy;
import mage.constants.PhaseStep;
@ -7,7 +6,6 @@ import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class CopyEnchantmentTest extends CardTestPlayerBase {
@ -23,18 +21,18 @@ public class CopyEnchantmentTest extends CardTestPlayerBase {
// Dragon creatures you control get +3/+3.
addCard(Zone.BATTLEFIELD, playerB, "Crucible of Fire", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Copy Enchantment");
setChoice(playerA, "Crucible of Fire");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertGraveyardCount(playerA, "Copy Enchantment",0);
assertGraveyardCount(playerA, "Copy Enchantment", 0);
assertPermanentCount(playerA, "Crucible of Fire", 1);
assertPowerToughness(playerA, "Furnace Whelp", 5,5);
assertPowerToughness(playerA, "Furnace Whelp", 5, 5);
}
@Test
@ -52,17 +50,22 @@ public class CopyEnchantmentTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Inferno Fist", "Geist of the Moors");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Copy Enchantment");
setChoice(playerB, "Yes"); // copy
setChoice(playerB, "Inferno Fist"); // copied
setChoice(playerB, "Silvercoat Lion"); // target for copy
setStrictChooseMode(true);
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertHandCount(playerA, "Inferno Fist", 0);
assertGraveyardCount(playerB, "Copy Enchantment",0);
assertGraveyardCount(playerB, "Copy Enchantment", 0);
assertPermanentCount(playerA, "Inferno Fist", 1);
assertPermanentCount(playerB, "Inferno Fist", 1);
assertPowerToughness(playerA, "Geist of the Moors", 5,1);
assertPowerToughness(playerB, "Silvercoat Lion", 4,2);
assertPowerToughness(playerA, "Geist of the Moors", 5, 1);
assertPowerToughness(playerB, "Silvercoat Lion", 4, 2);
}
}

View file

@ -0,0 +1,31 @@
package org.mage.test.cards.single.cmr;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author JayDi85
*/
public class RakshasaDebaserTest extends CardTestPlayerBase {
@Test
public void test_Playable() {
// Whenever Rakshasa Debaser attacks, put target creature card from defending player's graveyard onto the battlefield under your control.
addCard(Zone.BATTLEFIELD, playerA, "Rakshasa Debaser", 1);
addCard(Zone.GRAVEYARD, playerB, "Balduvian Bears", 1);
// attack and trigger
attack(1, playerA, "Rakshasa Debaser", playerB);
addTarget(playerA, "Balduvian Bears");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Balduvian Bears", 1); // from trigger
}
}