mirror of
https://github.com/correl/mage.git
synced 2025-04-13 01:01:11 -09:00
Added test.
This commit is contained in:
parent
c3624d5bce
commit
d2031d81f3
2 changed files with 36 additions and 7 deletions
Mage.Sets/src/mage/sets/battleforzendikar
Mage.Tests/src/test/java/org/mage/test/cards/rules
|
@ -47,10 +47,10 @@ import mage.filter.predicate.mageobject.ColorlessPredicate;
|
||||||
*/
|
*/
|
||||||
public class SwarmSurge extends CardImpl {
|
public class SwarmSurge extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Colorless creatures you control");
|
private static final FilterCreaturePermanent FILTER = new FilterCreaturePermanent("Colorless creatures you control");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(new ColorlessPredicate());
|
FILTER.add(new ColorlessPredicate());
|
||||||
}
|
}
|
||||||
|
|
||||||
public SwarmSurge(UUID ownerId) {
|
public SwarmSurge(UUID ownerId) {
|
||||||
|
@ -66,7 +66,7 @@ public class SwarmSurge extends CardImpl {
|
||||||
this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn));
|
this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn));
|
||||||
|
|
||||||
// Colorless creatures you control also gain first strike until end of turn.
|
// Colorless creatures you control also gain first strike until end of turn.
|
||||||
Effect effect = new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter);
|
Effect effect = new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, FILTER);
|
||||||
effect.setText("Colorless creatures you control also gain first strike until end of turn");
|
effect.setText("Colorless creatures you control also gain first strike until end of turn");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,11 +40,11 @@ public class CantCastTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* I control Void Winnower. But my opponent can cast Jayemdae Tome (that's
|
* I control Void Winnower. But my opponent can cast Jayemdae Tome (that's
|
||||||
* converted mana cost is even) He can cast other even spell.
|
* converted mana cost is even) He can cast other even spell. Test casting
|
||||||
*
|
* cost 4
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testVoidWinnower() {
|
public void testVoidWinnower1() {
|
||||||
// Your opponent can't cast spells with even converted mana costs. (Zero is even.)
|
// Your opponent can't cast spells with even converted mana costs. (Zero is even.)
|
||||||
// Your opponents can't block with creatures with even converted mana costs.
|
// Your opponents can't block with creatures with even converted mana costs.
|
||||||
addCard(Zone.BATTLEFIELD, playerB, "Void Winnower");
|
addCard(Zone.BATTLEFIELD, playerB, "Void Winnower");
|
||||||
|
@ -53,7 +53,7 @@ public class CantCastTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
addCard(Zone.HAND, playerA, "Jayemdae Tome", 1);
|
addCard(Zone.HAND, playerA, "Jayemdae Tome", 1);
|
||||||
|
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Jayemdae Tome");
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Jayemdae Tome"); // {4}
|
||||||
|
|
||||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
execute();
|
execute();
|
||||||
|
@ -64,6 +64,9 @@ public class CantCastTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test with X=3
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testVoidWinnower2() {
|
public void testVoidWinnower2() {
|
||||||
// Your opponent can't cast spells with even converted mana costs. (Zero is even.)
|
// Your opponent can't cast spells with even converted mana costs. (Zero is even.)
|
||||||
|
@ -87,6 +90,9 @@ public class CantCastTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test with X=4
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testVoidWinnower3() {
|
public void testVoidWinnower3() {
|
||||||
// Your opponent can't cast spells with even converted mana costs. (Zero is even.)
|
// Your opponent can't cast spells with even converted mana costs. (Zero is even.)
|
||||||
|
@ -136,4 +142,27 @@ public class CantCastTest extends CardTestPlayerBase {
|
||||||
assertHandCount(playerA, "Pine Walker", 1);
|
assertHandCount(playerA, "Pine Walker", 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test with casting cost = {0}
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testVoidWinnowerZero() {
|
||||||
|
// Your opponent can't cast spells with even converted mana costs. (Zero is even.)
|
||||||
|
// Your opponents can't block with creatures with even converted mana costs.
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Void Winnower");
|
||||||
|
|
||||||
|
// Metalcraft - {T}: Add one mana of any color to your mana pool. Activate this ability only if you control three or more artifacts.
|
||||||
|
addCard(Zone.HAND, playerA, "Mox Opal", 1); // {0}
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mox Opal");
|
||||||
|
|
||||||
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertHandCount(playerA, "Mox Opal", 1);
|
||||||
|
|
||||||
|
assertLife(playerB, 20);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue