added UT, fix small bug on Hour of Revelation

This commit is contained in:
igoudt 2017-07-02 13:08:03 +02:00
parent 1f59818515
commit b573d72883
4 changed files with 102 additions and 2 deletions

View file

@ -27,7 +27,6 @@
*/
package mage.cards.h;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.effects.common.DestroyAllEffect;
@ -39,6 +38,8 @@ import mage.constants.ComparisonType;
import mage.constants.Zone;
import mage.filter.common.FilterNonlandPermanent;
import java.util.UUID;
/**
*
* @author fireshoes
@ -51,7 +52,7 @@ public class HourOfRevelation extends CardImpl {
// Hour of Revelation costs {3} less to cast if there are ten or more nonland permanents on the battlefield.
SimpleStaticAbility ability = new SimpleStaticAbility(Zone.STACK,
new SpellCostReductionSourceEffect(3, new PermanentsOnTheBattlefieldCondition(
new FilterNonlandPermanent("there are ten or more nonland permanents on the battlefield"), ComparisonType.MORE_THAN, 9)));
new FilterNonlandPermanent("there are ten or more nonland permanents on the battlefield"), ComparisonType.MORE_THAN, 9, false)));
ability.setRuleAtTheTop(true);
this.addAbility(ability);

View file

@ -0,0 +1,33 @@
package org.mage.test.cards.single.hou;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class BontusLastReckoningTest extends CardTestPlayerBase {
private String reckoning = "Bontu's Last Reckoning";
@Test
public void testDelayedUntap(){
String pouncer = "Adorned Pouncer";
String angel = "Angel of Condemnation";
addCard(Zone.HAND, playerA, reckoning);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
addCard(Zone.BATTLEFIELD, playerA, pouncer);
addCard(Zone.BATTLEFIELD, playerB, angel);
addCard(Zone.BATTLEFIELD, playerB, "Island");
castSpell(1, PhaseStep.PRECOMBAT_MAIN,playerA, reckoning);
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();
assertTappedCount("Swamp", true, 3);
assertTappedCount("Island", false, 1);
assertGraveyardCount(playerA, pouncer, 1);
assertGraveyardCount(playerB, angel, 1);
}
}

View file

@ -0,0 +1,40 @@
package org.mage.test.cards.single.hou;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class ChampionOfWitsTest extends CardTestPlayerBase {
private final String champion = "Champion of Wits";
@Test
public void testEternalize(){
addCard(Zone.GRAVEYARD, playerA, champion);
addCard(Zone.BATTLEFIELD,playerA, "Island", 10);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA,"Eternalize {5}{U}{U}");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertHandCount(playerA, 2);
}
@Test
public void testEternalizeWithAnthem(){
String anthem = "Glorious Anthem";
addCard(Zone.GRAVEYARD, playerA, champion);
addCard(Zone.BATTLEFIELD,playerA, "Island", 10);
addCard(Zone.BATTLEFIELD, playerA, anthem);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA,"Eternalize {5}{U}{U}");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertHandCount(playerA, 3);
}
}

View file

@ -0,0 +1,26 @@
package org.mage.test.cards.single.hou;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class HourOfRevelationTest extends CardTestPlayerBase {
private final String hour = "Hour of Revelation";
@Test
public void testCountAllPlayers() {
addCard(Zone.HAND, playerA, hour, 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 6);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 5);
addCard(Zone.BATTLEFIELD, playerB, "Grizzly Bears", 5);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, hour);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertTappedCount("Plains", true, 3);
}
}