From 048fcba222a614acb26770d62c7dffe110562b40 Mon Sep 17 00:00:00 2001 From: DeepCrimson <98864333+DeepCrimson@users.noreply.github.com> Date: Sun, 12 Jun 2022 06:21:12 -0700 Subject: [PATCH] Test for Unlicensed Hearse (#9094) --- .../single/snc/UnlicensedHearseTest.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/snc/UnlicensedHearseTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/snc/UnlicensedHearseTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/snc/UnlicensedHearseTest.java new file mode 100644 index 0000000000..f64307421c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/snc/UnlicensedHearseTest.java @@ -0,0 +1,68 @@ +package org.mage.test.cards.single.snc; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Before; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * {@link mage.cards.u.UnlicensedHearse Unlicensed Hearse} + * {2} + * Artifact - Vehicle + * {T}: Exile up to two target cards from a single graveyard. + * Unlicensed Hearse's power and toughness are each equal to the + * number of cards exiled with it. + * Crew 2 + * + * @author DeepCrimson + */ +public class UnlicensedHearseTest extends CardTestPlayerBase { + + /** + * Give Player A one Unlicensed Hearse on the battlefield and give + * Player B two cards in their graveyard. + */ + @Before + public void createHearseAndFillGraveyard() { + addCard(Zone.BATTLEFIELD, playerA, "Unlicensed Hearse"); + addCard(Zone.GRAVEYARD, playerB, "Grizzly Bears"); + addCard(Zone.GRAVEYARD, playerB, "Forest Bear"); + } + + /** + * Test that exiling a single card with Unlicensed Hearse results + * in it being a 1/1. + */ + @Test + public void testExileOneCardFromGraveyard() { + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, + "{T}: Exile up to two target cards from a single graveyard.", + "Grizzly Bears"); + + setStrictChooseMode(true); + execute(); + assertAllCommandsUsed(); + + assertGraveyardCount(playerB, 1); + assertPowerToughness(playerA, "Unlicensed Hearse", 1, 1); + } + + /** + * Test that exiling two cards with Unlicensed Hearse from one + * graveyard results in it being a 2/2. + */ + @Test + public void testExileTwoCardsFromGraveyard() { + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, + "{T}: Exile up to two target cards from a single graveyard.", + new String[]{"Grizzly Bears", "Forest Bear"}); + + setStrictChooseMode(true); + execute(); + assertAllCommandsUsed(); + + assertGraveyardCount(playerB, 0); + assertPowerToughness(playerA, "Unlicensed Hearse", 2, 2); + } +}