mirror of
https://github.com/correl/mage.git
synced 2025-04-13 01:01:11 -09:00
Fixed two bugged tests.
This commit is contained in:
parent
4bdc4936f0
commit
97e44d1000
2 changed files with 28 additions and 25 deletions
Mage.Tests/src/test/java/org/mage/test
|
@ -15,56 +15,56 @@ 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 MindsDilationTest extends CardTestPlayerBase {
|
public class MindsDilationTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExileNonLandCardAndCastIt() {
|
public void testExileNonLandCardAndCastIt() {
|
||||||
|
|
||||||
removeAllCardsFromLibrary(playerA);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mind's Dilation {5}{U}{U} Enchantment
|
* Mind's Dilation {5}{U}{U} Enchantment Whenever an opponent casts his
|
||||||
* Whenever an opponent casts his or her first spell each turn, that player exiles the top card of his or her library.
|
* or her first spell each turn, that player exiles the top card of his
|
||||||
* If it's a nonland card, you may cast it without paying its mana cost.
|
* or her library. If it's a nonland card, you may cast it without
|
||||||
|
* paying its mana cost.
|
||||||
*/
|
*/
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Mind's Dilation", 1);
|
||||||
addCard(Zone.BATTLEFIELD, playerB, "Mind's Dilation", 1);
|
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
||||||
addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
|
addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
|
||||||
addCard(Zone.LIBRARY, playerA, "Divination", 1); // draw 2 cards
|
addCard(Zone.LIBRARY, playerA, "Divination", 1); // draw 2 cards
|
||||||
|
|
||||||
|
skipInitShuffling();
|
||||||
|
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||||
setChoice(playerB, "Yes");
|
setChoice(playerB, "Yes");
|
||||||
|
|
||||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
assertLife(playerB, 17);
|
assertLife(playerB, 17);
|
||||||
assertExileCount("Divination", 1);
|
assertExileCount("Divination", 0);
|
||||||
assertHandCount(playerB, 2); // free divination!
|
assertHandCount(playerB, 2); // free divination!
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExileNonLandCardDontCastIt() {
|
public void testExileNonLandCardDontCastIt() {
|
||||||
|
|
||||||
removeAllCardsFromLibrary(playerA);
|
removeAllCardsFromLibrary(playerA);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mind's Dilation {5}{U}{U} Enchantment
|
* Mind's Dilation {5}{U}{U} Enchantment Whenever an opponent casts his
|
||||||
* Whenever an opponent casts his or her first spell each turn, that player exiles the top card of his or her library.
|
* or her first spell each turn, that player exiles the top card of his
|
||||||
* If it's a nonland card, you may cast it without paying its mana cost.
|
* or her library. If it's a nonland card, you may cast it without
|
||||||
|
* paying its mana cost.
|
||||||
*/
|
*/
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Mind's Dilation", 1);
|
||||||
addCard(Zone.BATTLEFIELD, playerB, "Mind's Dilation", 1);
|
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
||||||
addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
|
addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
|
||||||
addCard(Zone.LIBRARY, playerA, "Divination", 1); // draw 2 cards
|
addCard(Zone.LIBRARY, playerA, "Divination", 1); // draw 2 cards
|
||||||
|
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||||
setChoice(playerB, "No"); // no, I don't want my free 2 cards
|
setChoice(playerB, "No"); // no, I don't want my free 2 cards
|
||||||
|
|
||||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
assertLife(playerB, 17);
|
assertLife(playerB, 17);
|
||||||
assertExileCount("Divination", 1);
|
assertExileCount("Divination", 1);
|
||||||
assertHandCount(playerB, 0); // Divination never cast
|
assertHandCount(playerB, 0); // Divination never cast
|
||||||
|
|
|
@ -574,6 +574,9 @@ public class TestPlayer implements Player {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (modes.getMinModes() <= modes.getSelectedModes().size()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return computerPlayer.chooseMode(modes, source, game); //To change body of generated methods, choose Tools | Templates.
|
return computerPlayer.chooseMode(modes, source, game); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1734,7 +1737,7 @@ public class TestPlayer implements Player {
|
||||||
public boolean canPaySacrificeCost(Permanent permanent, UUID sourceId, UUID controllerId, Game game) {
|
public boolean canPaySacrificeCost(Permanent permanent, UUID sourceId, UUID controllerId, Game game) {
|
||||||
return computerPlayer.canPaySacrificeCost(permanent, sourceId, controllerId, game);
|
return computerPlayer.canPaySacrificeCost(permanent, sourceId, controllerId, game);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FilterPermanent getSacrificeCostFilter() {
|
public FilterPermanent getSacrificeCostFilter() {
|
||||||
return computerPlayer.getSacrificeCostFilter();
|
return computerPlayer.getSacrificeCostFilter();
|
||||||
|
|
Loading…
Add table
Reference in a new issue