Tests refactoring

This commit is contained in:
magenoxx 2012-06-16 10:41:23 +04:00
parent 972a26a6bc
commit 397c393f1d
6 changed files with 206 additions and 207 deletions

View file

@ -1,81 +1,81 @@
package org.mage.test.cards.damage;
import mage.Constants;
import mage.Constants.PhaseStep;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author ayrat
*/
public class LightningBoltTest extends CardTestPlayerBase {
@Test
public void testDamageOpponent() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 17);
}
@Test
public void testDamageSelf() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA);
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 17);
assertLife(playerB, 20);
}
@Test
public void testDamageSmallCreature() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Sejiri Merfolk");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Sejiri Merfolk");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Sejiri Merfolk", 0);
}
@Test
public void testDamageBigCreature() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Craw Wurm");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Craw Wurm", 1);
}
@Test
public void testDamageBigCreatureTwice() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Craw Wurm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Craw Wurm");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Craw Wurm", 0);
}
}
package org.mage.test.cards.abilities.oneshot.damage;
import mage.Constants;
import mage.Constants.PhaseStep;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author ayrat
*/
public class LightningBoltTest extends CardTestPlayerBase {
@Test
public void testDamageOpponent() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 17);
}
@Test
public void testDamageSelf() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA);
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 17);
assertLife(playerB, 20);
}
@Test
public void testDamageSmallCreature() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Sejiri Merfolk");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Sejiri Merfolk");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Sejiri Merfolk", 0);
}
@Test
public void testDamageBigCreature() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Craw Wurm");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Craw Wurm", 1);
}
@Test
public void testDamageBigCreatureTwice() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Craw Wurm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Craw Wurm");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Craw Wurm", 0);
}
}

View file

@ -1,26 +1,26 @@
package org.mage.test.cards.damage;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestBase;
/**
* @author Loki
*/
public class PsionicBlastTest extends CardTestBase {
@Test
public void testDamageInPlayer() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island");
addCard(Constants.Zone.HAND, playerA, "Psionic Blast");
castSpell(playerA, "Psionic Blast");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 18);
assertLife(playerB, 16);
}
}
package org.mage.test.cards.abilities.oneshot.damage;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestBase;
/**
* @author Loki
*/
public class PsionicBlastTest extends CardTestBase {
@Test
public void testDamageInPlayer() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island");
addCard(Constants.Zone.HAND, playerA, "Psionic Blast");
castSpell(playerA, "Psionic Blast");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 18);
assertLife(playerB, 16);
}
}

View file

@ -1,8 +1,7 @@
package org.mage.test.cards.damage;
package org.mage.test.cards.abilities.oneshot.damage;
import mage.Constants;
import mage.counters.CounterType;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@ -13,7 +12,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author BetaSteward
*/
public class TestSpitefulShadows extends CardTestPlayerBase {
public class SpitefulShadowsTest extends CardTestPlayerBase {
@Test
public void testCard() {

View file

@ -1,64 +1,64 @@
package org.mage.test.cards.destroy;
import mage.Constants;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestBase;
public class HideousEndTest extends CardTestBase {
@Test
public void testWithValidTarget() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.HAND, playerA, "Hideous End");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Copper Myr");
castSpell(playerA, "Hideous End");
addFixedTarget(playerA, "Hideous End", "Copper Myr");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Copper Myr", 0);
assertLife(playerB, 18);
}
@Test
public void testWithInvalidTarget() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.HAND, playerA, "Hideous End");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Zombie Goliath");
castSpell(playerA, "Hideous End");
addFixedTarget(playerA, "Hideous End", "Zombie Goliath");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Zombie Goliath", 1);
assertLife(playerB, 20);
}
@Test
@Ignore
public void testWithPossibleProtection() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.HAND, playerA, "Hideous End");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Copper Myr");
addCard(Constants.Zone.HAND, playerB, "Apostle's Blessing");
castSpell(playerA, "Hideous End");
addFixedTarget(playerA, "Hideous End", "Copper Myr");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Copper Myr", 1);
assertLife(playerB, 20);
}
}
package org.mage.test.cards.abilities.oneshot.destroy;
import mage.Constants;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestBase;
public class HideousEndTest extends CardTestBase {
@Test
public void testWithValidTarget() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.HAND, playerA, "Hideous End");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Copper Myr");
castSpell(playerA, "Hideous End");
addFixedTarget(playerA, "Hideous End", "Copper Myr");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Copper Myr", 0);
assertLife(playerB, 18);
}
@Test
public void testWithInvalidTarget() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.HAND, playerA, "Hideous End");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Zombie Goliath");
castSpell(playerA, "Hideous End");
addFixedTarget(playerA, "Hideous End", "Zombie Goliath");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Zombie Goliath", 1);
assertLife(playerB, 20);
}
@Test
@Ignore
public void testWithPossibleProtection() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp");
addCard(Constants.Zone.HAND, playerA, "Hideous End");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Copper Myr");
addCard(Constants.Zone.HAND, playerB, "Apostle's Blessing");
castSpell(playerA, "Hideous End");
addFixedTarget(playerA, "Hideous End", "Copper Myr");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Copper Myr", 1);
assertLife(playerB, 20);
}
}

View file

@ -1,31 +1,31 @@
package org.mage.test.cards.destroy;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestBase;
/**
* @author Loki
*/
public class LeaveNoTraceTest extends CardTestBase {
@Test
public void testDestroy() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
addCard(Constants.Zone.HAND, playerA, "Leave No Trace");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Asceticism"); // Green
addCard(Constants.Zone.BATTLEFIELD, playerB, "Awakening Zone"); // Green
addCard(Constants.Zone.BATTLEFIELD, playerB, "Back from the Brink"); // Blue
castSpell(playerA, "Leave No Trace");
addFixedTarget(playerA, "Leave No Trace", "Asceticism");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Asceticism", 0);
assertPermanentCount(playerB, "Awakening Zone", 0);
assertPermanentCount(playerB, "Back from the Brink", 1);
}
}
package org.mage.test.cards.abilities.oneshot.destroy;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestBase;
/**
* @author Loki
*/
public class LeaveNoTraceTest extends CardTestBase {
@Test
public void testDestroy() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
addCard(Constants.Zone.HAND, playerA, "Leave No Trace");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Asceticism"); // Green
addCard(Constants.Zone.BATTLEFIELD, playerB, "Awakening Zone"); // Green
addCard(Constants.Zone.BATTLEFIELD, playerB, "Back from the Brink"); // Blue
castSpell(playerA, "Leave No Trace");
addFixedTarget(playerA, "Leave No Trace", "Asceticism");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Asceticism", 0);
assertPermanentCount(playerB, "Awakening Zone", 0);
assertPermanentCount(playerB, "Back from the Brink", 1);
}
}

View file

@ -1,4 +1,4 @@
package org.mage.test.cards.events;
package org.mage.test.cards.triggers.events;
import mage.Constants;
import mage.counters.CounterType;
@ -9,7 +9,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author BetaSteward_at_googlemail.com
*/
public class TestSearchShuffle extends CardTestPlayerBase {
public class SearchShuffleTest extends CardTestPlayerBase {
/**