From 6e6d412535dc02d073341dc3b7437b9e69818c4c Mon Sep 17 00:00:00 2001 From: Derek Monturo Date: Thu, 25 May 2017 00:40:27 -0400 Subject: [PATCH] UT for Lambholt replicating bug in #3427 --- .../single/soi/LambholtPacifistTest.java | 52 +++++++++++++++++++ .../combat/AttackBlockRestrictionsTest.java | 8 +-- 2 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/soi/LambholtPacifistTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/LambholtPacifistTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/LambholtPacifistTest.java new file mode 100644 index 00000000000..c6c1cf23b43 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/LambholtPacifistTest.java @@ -0,0 +1,52 @@ +package org.mage.test.cards.single.soi; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author escplan9 + */ +public class LambholtPacifistTest extends CardTestPlayerBase { + + /* + Lambholt Pacifist {1}{G} + Creature - Human Shaman Werewolf 3/3 + Lambholt Pacifist can't attack unless you control a creature with power 4 or greater. + At the beginning of each upkeep, if no spells were cast last turn, transform Lambholt Pacifist. + */ + private final String lambholt = "Lambholt Pacifist"; + + @Test + public void uncrewedVehicle_LambholtCannotAttack() { + + /* + Heart of Kiran {2} + Legendary Artifact - Vehicle + Flying, vigilance + Crew 3 (Tap any number of creatures you control with total power 3 or more: This Vehicle becomes an artifact creature until end of turn.) + You may remove a loyalty counter from a planeswalker you control rather than pay Heart of Kiran's crew cost. + */ + String heartKiran = "Heart of Kiran"; + String orni = "Ornithopter"; // {0} 0/2 flyer - just needs something to cast to prevent lambholt transforming + + addCard(Zone.HAND, playerA, lambholt); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + addCard(Zone.BATTLEFIELD, playerA, heartKiran); + addCard(Zone.HAND, playerB, orni); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lambholt); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, orni); + + attack(3, playerA, lambholt); + + setStopAt(3, PhaseStep.END_COMBAT); + execute(); + + assertPermanentCount(playerB, orni, 1); + assertTapped(lambholt, false); + assertLife(playerB, 20); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java b/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java index 1fd7e8dc049..304530946b3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java @@ -5,11 +5,10 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.permanent.Permanent; import org.junit.Assert; -import org.junit.Test; -import org.mage.test.serverside.base.CardTestPlayerBase; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; /** * Test restrictions for choosing attackers and blockers. @@ -543,7 +542,4 @@ public class AttackBlockRestrictionsTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 20); } - - - }