-
Notifications
You must be signed in to change notification settings - Fork 783
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit tests for Unable to Scream
- Loading branch information
1 parent
2f85026
commit be21701
Showing
1 changed file
with
125 additions
and
0 deletions.
There are no files selected for viewing
125 changes: 125 additions & 0 deletions
125
Mage.Tests/src/test/java/org/mage/test/cards/single/dsk/UnableToScreamTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
package org.mage.test.cards.single.dsk; | ||
|
||
import mage.abilities.mana.GreenManaAbility; | ||
import mage.constants.*; | ||
import org.junit.Test; | ||
import org.mage.test.serverside.base.CardTestPlayerBase; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
/** | ||
* @author markort147 | ||
*/ | ||
public class UnableToScreamTest extends CardTestPlayerBase { | ||
|
||
public static final String UNABLE_TO_SCREAM = "Unable to Scream"; | ||
|
||
@Test | ||
public void cannotTurnFaceUpTest() { | ||
String akroma = "Akroma, Angel of Fury"; | ||
String breakOpen = "Break Open"; | ||
|
||
addCard(Zone.HAND, playerB, akroma); | ||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 6); | ||
|
||
addCard(Zone.HAND, playerA, UNABLE_TO_SCREAM); | ||
addCard(Zone.HAND, playerA, breakOpen, 1); | ||
addCard(Zone.BATTLEFIELD, playerA, "Island", 2); | ||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); | ||
|
||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, akroma + " using Morph"); | ||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, UNABLE_TO_SCREAM, EmptyNames.FACE_DOWN_CREATURE.getTestCommand(), true); | ||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, breakOpen, EmptyNames.FACE_DOWN_CREATURE.getTestCommand()); | ||
|
||
setStopAt(4, PhaseStep.BEGIN_COMBAT); | ||
execute(); | ||
|
||
assertPermanentCount(playerB, EmptyNames.FACE_DOWN_CREATURE.getTestCommand(), 1); | ||
assertPowerToughness(playerB, EmptyNames.FACE_DOWN_CREATURE.getTestCommand(), 0, 2); | ||
} | ||
|
||
@Test | ||
public void turnFaceUpAfterRemovingAuraTest() { | ||
String akroma = "Akroma, Angel of Fury"; | ||
String breakOpen = "Break Open"; | ||
String removal = "Appetite for the Unnatural"; | ||
|
||
addCard(Zone.HAND, playerB, akroma); | ||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 6); | ||
addCard(Zone.HAND, playerB, removal); | ||
addCard(Zone.BATTLEFIELD, playerB, "Forest", 3); | ||
|
||
addCard(Zone.HAND, playerA, UNABLE_TO_SCREAM); | ||
addCard(Zone.HAND, playerA, breakOpen, 1); | ||
addCard(Zone.BATTLEFIELD, playerA, "Island", 2); | ||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); | ||
|
||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, akroma + " using Morph"); | ||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, UNABLE_TO_SCREAM, EmptyNames.FACE_DOWN_CREATURE.getTestCommand()); | ||
castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, removal, UNABLE_TO_SCREAM); | ||
castSpell(5, PhaseStep.PRECOMBAT_MAIN, playerA, breakOpen, EmptyNames.FACE_DOWN_CREATURE.getTestCommand()); | ||
|
||
setStopAt(5, PhaseStep.BEGIN_COMBAT); | ||
execute(); | ||
|
||
assertPermanentCount(playerB, EmptyNames.FACE_DOWN_CREATURE.getTestCommand(), 0); | ||
assertPermanentCount(playerB, akroma, 1); | ||
} | ||
|
||
|
||
@Test | ||
public void becomesToyTest() { | ||
String elves = "Llanowar Elves"; | ||
|
||
addCard(Zone.BATTLEFIELD, playerB, elves); | ||
addCard(Zone.HAND, playerA, UNABLE_TO_SCREAM); | ||
addCard(Zone.BATTLEFIELD, playerA, "Island", 2); | ||
|
||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, UNABLE_TO_SCREAM, elves); | ||
|
||
setStopAt(1, PhaseStep.BEGIN_COMBAT); | ||
execute(); | ||
|
||
assertPermanentCount(playerB, elves, 1); | ||
assertPermanentCount(playerA, UNABLE_TO_SCREAM, 1); | ||
assertPowerToughness(playerB, elves, 0, 2); | ||
assertAbility(playerB, elves, new GreenManaAbility(), false); | ||
List<CardType> types = Arrays.asList(CardType.CREATURE, CardType.ARTIFACT); | ||
List<SubType> subTypes = Arrays.asList(SubType.TOY, SubType.ELF, SubType.DRUID); | ||
types.forEach(t -> | ||
subTypes.forEach(st -> | ||
assertType(elves, t, st) | ||
) | ||
); | ||
} | ||
|
||
@Test | ||
public void removeAuraTest() { | ||
String elves = "Llanowar Elves"; | ||
String removal = "Appetite for the Unnatural"; | ||
|
||
addCard(Zone.BATTLEFIELD, playerB, elves); | ||
addCard(Zone.BATTLEFIELD, playerB, "Forest", 3); | ||
addCard(Zone.HAND, playerB, removal); | ||
addCard(Zone.HAND, playerA, UNABLE_TO_SCREAM); | ||
addCard(Zone.BATTLEFIELD, playerA, "Island", 2); | ||
|
||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, UNABLE_TO_SCREAM, elves); | ||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, removal, UNABLE_TO_SCREAM); | ||
|
||
setStopAt(2, PhaseStep.BEGIN_COMBAT); | ||
execute(); | ||
|
||
assertPermanentCount(playerB, elves, 1); | ||
assertPermanentCount(playerA, UNABLE_TO_SCREAM, 0); | ||
|
||
assertPowerToughness(playerB, elves, 1, 1); | ||
assertType(elves, CardType.CREATURE, true); | ||
assertType(elves, CardType.ARTIFACT, false); | ||
assertSubtype(elves, SubType.ELF); | ||
assertSubtype(elves, SubType.DRUID); | ||
assertNotSubtype(elves, SubType.TOY); | ||
assertAbility(playerB, elves, new GreenManaAbility(), true); | ||
} | ||
} |