ProtectionFromColorTest, ProtectionFromTypeTest.

This commit is contained in:
magenoxx 2011-03-12 15:14:14 +03:00
parent f97154fd56
commit 8722b825e6
2 changed files with 104 additions and 0 deletions

View file

@ -0,0 +1,55 @@
package org.mage.test.serverside.cards.abilities;
import mage.Constants;
import mage.filter.Filter;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestAPI;
import org.mage.test.serverside.base.CardTestBase;
/**
* @author ayratn
*/
public class ProtectionFromColorTest extends CardTestBase {
@Test
public void testAgainstAbilityInTheStack() {
useRedDefault();
addCard(Constants.Zone.BATTLEFIELD, computerA, "Royal Assassin");
// tapped White Knight with Protection from Black
addCard(Constants.Zone.BATTLEFIELD, computerB, "White Knight", 1, true);
// one not tapped White Knight to prevent AI from attacking
addCard(Constants.Zone.BATTLEFIELD, computerB, "White Knight", 1, false);
setStopOnTurn(2);
execute();
assertTurn(2);
assertResult(computerA, CardTestAPI.GameResult.DRAW);
assertLife(computerA, 20);
assertLife(computerB, 20);
// no one should be destroyed
assertPermanentCount(computerB, "White Knight", 2);
}
@Test
public void testAgainstAbilityInTheStackNoProtection() {
useRedDefault();
addCard(Constants.Zone.BATTLEFIELD, computerA, "Royal Assassin");
addCard(Constants.Zone.BATTLEFIELD, computerB, "Runeclaw Bear", 1, true);
addCard(Constants.Zone.BATTLEFIELD, computerB, "Runeclaw Bear", 1, false);
setStopOnTurn(2);
execute();
assertTurn(2);
assertResult(computerA, CardTestAPI.GameResult.DRAW);
assertLife(computerA, 20);
assertLife(computerB, 20);
// One should have beendestroyed by Royal Assassin
assertPermanentCount(computerB, "Runeclaw Bear", 1);
}
}

View file

@ -0,0 +1,49 @@
package org.mage.test.serverside.cards.abilities;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestBase;
/**
* @author ayratn
*/
public class ProtectionFromTypeTest extends CardTestBase {
@Test
public void testProtectionFromArtifacts() {
useRedDefault();
addCard(Constants.Zone.HAND, computerA, "Trigon of Corruption");
addCard(Constants.Zone.BATTLEFIELD, computerB, "Tel-Jilad Fallen");
setStopOnTurn(2);
execute();
assertTurn(2);
assertResult(computerA, GameResult.DRAW);
assertLife(computerA, 20);
assertLife(computerB, 20);
// no one should be destroyed
assertPermanentCount(computerB, "Tel-Jilad Fallen", 1);
}
@Test
public void testNoProtection() {
useRedDefault();
addCard(Constants.Zone.HAND, computerA, "Trigon of Corruption");
addCard(Constants.Zone.BATTLEFIELD, computerB, "Coral Merfolk");
setStopOnTurn(2);
execute();
assertTurn(2);
assertResult(computerA, GameResult.DRAW);
assertLife(computerA, 20);
assertLife(computerB, 20);
// no one should be destroyed
assertPermanentCount(computerB, "Coral Merfolk", 0);
}
}