From 895e65a42c24fe0334eb984e46d6934f5a517c41 Mon Sep 17 00:00:00 2001 From: drmDev Date: Fri, 5 Aug 2016 21:29:37 -0400 Subject: [PATCH] Kusari-Gama test confirms bug for #2154 --- .../abilities/equipped/KusariGamaTest.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/KusariGamaTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/KusariGamaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/KusariGamaTest.java new file mode 100644 index 0000000000..5b9a376270 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/KusariGamaTest.java @@ -0,0 +1,48 @@ +package org.mage.test.cards.abilities.equipped; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.permanent.Permanent; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) + */ +public class KusariGamaTest extends CardTestPlayerBase { + + // reported bug: trigger occurs but no damage is dealt + @Test + public void testTriggeredAbilityDealsDamage() { + + // Kusari-Gama - Artifact Equipment - Equip {3} + // Equipped creature has "2: This creature gets +1/+0 until end of turn." + // Whenever equipped creature deals damage to a blocking creature, Kusari-Gama deals that much damage to each other creature defending player controls. + addCard(Zone.BATTLEFIELD, playerA, "Kusari-Gama"); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); + addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate"); // 2/3 vigilance {1}{G} + + addCard(Zone.BATTLEFIELD, playerB, "Wall of Omens"); // 0/4 {1}{W} + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); // 2/2 {1}{W} + addCard(Zone.BATTLEFIELD, playerB, "Hill Giant"); // 3/3 {3}{R} + + activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "Equip {3}", "Sylvan Advocate"); + attack(1, playerA, "Sylvan Advocate"); + block(1, playerB, "Wall of Omens", "Sylvan Advocate"); + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertPermanentCount(playerA, "Kusari-Gama", 1); + assertPermanentCount(playerB, "Wall of Omens", 1); + assertPermanentCount(playerB, "Hill Giant", 1); + + Permanent wallPerm = getPermanent("Wall of Omens", playerB); + Permanent giantPerm = getPermanent("Hill Giant", playerB); + Assert.assertEquals("Wall of Omens should have 2 damage dealt to it", 2, wallPerm.getDamage()); + Assert.assertEquals("Hill Giant should have 2 damage dealt to it", 2, giantPerm.getDamage()); + + assertGraveyardCount(playerB, "Silvercoat Lion", 2); + } +}