* Fixed that Sift Through Sands failed randomly (fixes #4463).

This commit is contained in:
LevelX2 2018-02-07 11:00:51 +01:00
parent a638fcb313
commit 557ac244d3

View file

@ -10,18 +10,19 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
* @author BetaSteward
*/
public class SiftThroughSandsTest extends CardTestPlayerBase {
/*
* Sift Through Sands
* Instant Arcane, 1UU (3)
* Draw two cards, then discard a card.
* If you've cast a spell named Peer Through Depths and a spell named Reach
* Through Mists this turn, you may search your library for a card named
* If you've cast a spell named Peer Through Depths and a spell named Reach
* Through Mists this turn, you may search your library for a card named
* The Unspeakable, put it onto the battlefield, then shuffle your library.
*
* Peer Through Depths
* Instant Arcane, 1U (2)
* Look at the top five cards of your library. You may reveal an instant or
* sorcery card from among them and put it into your hand. Put the rest on
* Look at the top five cards of your library. You may reveal an instant or
* sorcery card from among them and put it into your hand. Put the rest on
* the bottom of your library in any order.
*
* Reach Through Mists
@ -31,22 +32,20 @@ public class SiftThroughSandsTest extends CardTestPlayerBase {
* The Unspeakable
* Legendary Creature Spirit 6/7, 6UUU (9)
* Flying, trample
* Whenever The Unspeakable deals combat damage to a player, you may return
* Whenever The Unspeakable deals combat damage to a player, you may return
* target Arcane card from your graveyard to your hand.
*
*/
// TODO: This test fails sometimes if building the complete test project
// The cause is still unknown
// test that The Unspeakable is put onto the battlefield
*/
@Test
public void testTheUnspeakable() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
addCard(Zone.HAND, playerA, "Sift Through Sands");
addCard(Zone.HAND, playerA, "Peer Through Depths");
addCard(Zone.HAND, playerA, "Reach Through Mists");
addCard(Zone.LIBRARY, playerA, "The Unspeakable");
addCard(Zone.LIBRARY, playerA, "The Unspeakable", 4); // So that at least one will be in library even if you draw 2 with Sift and 1 with Reach
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reach Through Mists");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Peer Through Depths");
@ -54,15 +53,12 @@ public class SiftThroughSandsTest extends CardTestPlayerBase {
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "The Unspeakable", 1);
assertHandCount(playerA, 2);
}
// TODO: This test fails sometimes if building the complete test project
// The cause is still unknown
// test that The Unspeakable is not put onto the battlefield
@Test
public void testNotTheUnspeakable() {
@ -70,18 +66,18 @@ public class SiftThroughSandsTest extends CardTestPlayerBase {
addCard(Zone.HAND, playerA, "Sift Through Sands");
addCard(Zone.HAND, playerA, "Peer Through Depths");
addCard(Zone.HAND, playerA, "Reach Through Mists");
addCard(Zone.LIBRARY, playerA, "The Unspeakable");
addCard(Zone.LIBRARY, playerA, "The Unspeakable", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reach Through Mists");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sift Through Sands");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "The Unspeakable", 0);
assertHandCount(playerA, 3);
}
}