mirror of
https://github.com/correl/mage.git
synced 2025-04-11 09:11:12 -09:00
Failing test for equipping opponent's creature
This commit is contained in:
parent
6978a7f871
commit
c5861a3c2e
2 changed files with 75 additions and 0 deletions
Mage.Tests/src/test/java/org/mage/test
|
@ -0,0 +1,71 @@
|
|||
package org.mage.test.cards.abilities.activated;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author noxx
|
||||
*/
|
||||
public class EquipAbilityTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Tests equipping creature with hexproof
|
||||
*/
|
||||
@Test
|
||||
public void testEquipHexproof() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Ring of Evos Isle");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Merfolk Spy");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
|
||||
|
||||
activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Merfolk Spy");
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
Permanent merfolk = getPermanent("Merfolk Spy", playerA);
|
||||
Assert.assertNotNull(merfolk);
|
||||
Assert.assertEquals(1, merfolk.getAttachments().size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests equipping creature with shroud
|
||||
*/
|
||||
@Test
|
||||
public void testEquipShroud() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Ring of Evos Isle");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Simic Sky Swallower");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
|
||||
|
||||
activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Simic Sky Swallower");
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
Permanent sky = getPermanent("Simic Sky Swallower", playerA);
|
||||
Assert.assertNotNull(sky);
|
||||
Assert.assertEquals(0, sky.getAttachments().size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests equipping opponent's creature
|
||||
*/
|
||||
@Test
|
||||
public void testEquipOpponentsCreature() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Ring of Evos Isle");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Llanowar Elves");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
|
||||
|
||||
activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Llanowar Elves");
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
Permanent elves = getPermanent("Llanowar Elves", playerB);
|
||||
Assert.assertNotNull(elves);
|
||||
Assert.assertEquals(0, elves.getAttachments().size());
|
||||
}
|
||||
|
||||
}
|
|
@ -539,6 +539,10 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
Assert.assertEquals("(Graveyard) Card counts are not equal (" + cardName + ")", count, actualCount);
|
||||
}
|
||||
|
||||
public Permanent getPermanent(String cardName, Player player) {
|
||||
return getPermanent(cardName, player.getId());
|
||||
}
|
||||
|
||||
public Permanent getPermanent(String cardName, UUID controller) {
|
||||
Permanent permanent0 = null;
|
||||
int count = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue