mirror of
https://github.com/magefree/mage.git
synced 2026-01-19 09:49:54 -08:00
Test for equip ability.
This commit is contained in:
parent
e5999166d8
commit
d004525027
2 changed files with 50 additions and 3 deletions
|
|
@ -0,0 +1,47 @@
|
|||
package org.mage.test.ai;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import mage.Constants;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestBase;
|
||||
|
||||
/**
|
||||
* Make sure AI uses equip ability once.
|
||||
*
|
||||
* @author ayratn
|
||||
*/
|
||||
public class EquipAbilityTest extends CardTestBase {
|
||||
|
||||
@Test
|
||||
public void testLevelUpAbilityUsage() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Boros Swiftblade");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Blade of the Bloodchief");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Sacred Foundry", 1);
|
||||
setStopOnTurn(3);
|
||||
|
||||
execute();
|
||||
|
||||
Permanent boros = getPermanent("Boros Swiftblade", playerA.getId());
|
||||
Assert.assertNotNull(boros);
|
||||
|
||||
Assert.assertEquals("Not equipped", 1, boros.getAttachments().size());
|
||||
|
||||
int count = 0;
|
||||
int tapped = 0;
|
||||
for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) {
|
||||
if (permanent.getControllerId().equals(playerA.getId())) {
|
||||
if (permanent.getCardType().contains(Constants.CardType.LAND)) {
|
||||
count++;
|
||||
if (permanent.isTapped()) {
|
||||
tapped++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assert.assertEquals(6, count);
|
||||
Assert.assertEquals(1, tapped);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue