Tests: fixed tests with wrong stop command;

This commit is contained in:
Oleg Agafonov 2019-01-27 23:18:18 +04:00
parent 42e8ca2843
commit c4877902c6
3 changed files with 30 additions and 32 deletions

View file

@ -12,15 +12,15 @@ public class AuratouchedMageTest extends CardTestPlayerBase {
@Test @Test
public void testSearch() { public void testSearch() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 10); addCard(Zone.BATTLEFIELD, playerA, "Plains", 10);
addCard(Zone.HAND, playerA, "Auratouched Mage");
addCard(Zone.HAND, playerA, "Auratouched Mage"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Auratouched Mage");
addCard(Zone.LIBRARY, playerA, "White Ward", 1);
addTarget(playerA, "White Ward");
castSpell(0, PhaseStep.PRECOMBAT_MAIN, playerA, "Auratouched Mage"); setStopAt(1, PhaseStep.BEGIN_COMBAT);
addCard(Zone.LIBRARY, playerA, "White Ward", 1); execute();
setChoice(playerA, "White ward"); assertAllCommandsUsed();
setStopAt(0, PhaseStep.PRECOMBAT_MAIN);
execute();
} }
} }

View file

@ -7,64 +7,64 @@ import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase; import org.mage.test.serverside.base.CardTestPlayerBase;
/** /**
*
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
*/ */
public class ReflectorMageTest extends CardTestPlayerBase { public class ReflectorMageTest extends CardTestPlayerBase {
/** /**
* Reported bug: Reflector Mage returning a creature to its owners hand is additionally * Reported bug: Reflector Mage returning a creature to its owners hand is additionally
* incorrectly preventing the Reflector Mage's owner from casting that same creature. * incorrectly preventing the Reflector Mage's owner from casting that same creature.
*/ */
@Test @Test
public void testReflectorMageAllowsOwnerToCastCreatureReturnedOnSameTurn() { public void testReflectorMageAllowsOwnerToCastCreatureReturnedOnSameTurn() {
// {1}{W}{U} When Reflector Mage enters the battlefield, return target creature an opponent controls to its owner's hand. // {1}{W}{U} When Reflector Mage enters the battlefield, return target creature an opponent controls to its owner's hand.
// That creature's owner can't cast spells with the same name as that creature until your next turn. // That creature's owner can't cast spells with the same name as that creature until your next turn.
addCard(Zone.HAND, playerA, "Reflector Mage"); // 2/3 addCard(Zone.HAND, playerA, "Reflector Mage"); // 2/3
addCard(Zone.HAND, playerA, "Bronze Sable", 1); // (2) 2/1 addCard(Zone.HAND, playerA, "Bronze Sable", 1); // (2) 2/1
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Island", 2); addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1); addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reflector Mage"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reflector Mage");
addTarget(playerA, "Bronze Sable"); addTarget(playerA, "Bronze Sable");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Bronze Sable"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Bronze Sable");
execute(); execute();
assertPermanentCount(playerB, "Bronze Sable", 0); assertPermanentCount(playerB, "Bronze Sable", 0);
assertHandCount(playerB, "Bronze Sable", 1); assertHandCount(playerB, "Bronze Sable", 1);
assertPermanentCount(playerA, "Reflector Mage", 1); assertPermanentCount(playerA, "Reflector Mage", 1);
assertPermanentCount(playerA, "Bronze Sable", 1); assertPermanentCount(playerA, "Bronze Sable", 1);
} }
/** /**
* Basic test to confirm the restriction effect still works on the opponent. * Basic test to confirm the restriction effect still works on the opponent.
*/ */
@Test @Test
public void testReflectorMageRestrictionEffect() { public void testReflectorMageRestrictionEffect() {
// {1}{W}{U} When Reflector Mage enters the battlefield, return target creature an opponent controls to its owner's hand. // {1}{W}{U} When Reflector Mage enters the battlefield, return target creature an opponent controls to its owner's hand.
// That creature's owner can't cast spells with the same name as that creature until your next turn. // That creature's owner can't cast spells with the same name as that creature until your next turn.
addCard(Zone.HAND, playerA, "Reflector Mage"); // 2/3 addCard(Zone.HAND, playerA, "Reflector Mage"); // 2/3
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Island", 2); addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1); // (2) 2/1 addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1); // (2) 2/1
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reflector Mage"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reflector Mage");
addTarget(playerA, "Bronze Sable"); addTarget(playerA, "Bronze Sable");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Bronze Sable"); // should not be allowed castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Bronze Sable"); // should not be allowed
setStopAt(2, PhaseStep.END_TURN);
execute(); execute();
assertPermanentCount(playerB, "Bronze Sable", 0); assertPermanentCount(playerB, "Bronze Sable", 0);
assertHandCount(playerB, "Bronze Sable", 1); assertHandCount(playerB, "Bronze Sable", 1);
assertPermanentCount(playerA, "Reflector Mage", 1); assertPermanentCount(playerA, "Reflector Mage", 1);

View file

@ -7,18 +7,16 @@ import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase; import org.mage.test.serverside.base.CardTestPlayerBase;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public class NewCreaturesAreRemovedTest extends CardTestPlayerBase { public class NewCreaturesAreRemovedTest extends CardTestPlayerBase {
/** /**
* I was playing with a Tamiyo's Journal in the battlefield. * I was playing with a Tamiyo's Journal in the battlefield.
* * <p>
* During my turn I rollbacked. The clue generated by Tamiyo's Journal * During my turn I rollbacked. The clue generated by Tamiyo's Journal
* stayed on battlefield and when my turn started again, it re-investigated * stayed on battlefield and when my turn started again, it re-investigated
* for another one. * for another one.
*
*/ */
@Test @Test
public void testTamiyosJournal() { public void testTamiyosJournal() {
@ -93,9 +91,9 @@ public class NewCreaturesAreRemovedTest extends CardTestPlayerBase {
playLand(7, PhaseStep.PRECOMBAT_MAIN, playerA, "Port Town"); playLand(7, PhaseStep.PRECOMBAT_MAIN, playerA, "Port Town");
attack(7, playerA, "Silvercoat Lion"); attack(7, playerA, "Silvercoat Lion");
rollbackTurns(7, PhaseStep.END_TURN, playerA, 0); rollbackTurns(7, PhaseStep.POSTCOMBAT_MAIN, playerA, 0);
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN); setStopAt(7, PhaseStep.END_TURN);
execute(); execute();
assertPermanentCount(playerA, "Port Town", 1); assertPermanentCount(playerA, "Port Town", 1);