Added some tests.

This commit is contained in:
LevelX2 2018-06-06 17:30:03 +02:00
parent ae8fa6aa10
commit 87e60f407b
2 changed files with 64 additions and 1 deletions

View file

@ -0,0 +1,49 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.mage.test.cards.abilities.oneshot.library;
import java.util.ArrayList;
import mage.cards.Card;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class PutToLibraryTest extends CardTestPlayerBase {
@Test
public void testPutSecondFromTop() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
// Put target creature into its owner's library second from the top. Its controller gains 3 life.
addCard(Zone.HAND, playerA, "Oust"); // Sorcery {W}
addCard(Zone.BATTLEFIELD, playerB, "Dread Wanderer");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oust", "Dread Wanderer");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Oust", 1);
assertLibraryCount(playerB, "Dread Wanderer", 1);
assertLife(playerA, 20);
assertLife(playerB, 23);
ArrayList<Card> cardArray = new ArrayList<>(playerB.getLibrary().getCards(currentGame));
Assert.assertTrue("Library has no cards but should have", cardArray.size() > 1);
Card secondCard = cardArray.get(1);
Assert.assertTrue("Second card from top should be Dread Wanderer, bnut it isn't",
secondCard != null && secondCard.getName().equals("Dread Wanderer"));
}
}

View file

@ -9,7 +9,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author LevelX2
*/
public class DreadWandererTest extends CardTestPlayerBase {
public class EntersTheBattlefieldTappedTest extends CardTestPlayerBase {
/**
* Creatures that enter the battlefield tapped, like Dread Wanderer, if you
@ -49,4 +49,18 @@ public class DreadWandererTest extends CardTestPlayerBase {
assertTapped("Dread Wanderer", true);
}
@Test
public void testScryLandEntersTapped() {
// Temple of Enlightenment enters the battlefield tapped.
// When Temple of Enlightenment enters the battlefield, scry 1. (Look at the top card of your library. You may put that card on the bottom of your library.)
addCard(Zone.HAND, playerA, "Temple of Enlightenment"); // Land
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Temple of Enlightenment");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Temple of Enlightenment", 1);
assertTapped("Temple of Enlightenment", true);
}
}