From 6eba170e3c87ddfb4151c0a15bb6a01ac2925afd Mon Sep 17 00:00:00 2001 From: igoudt Date: Sat, 8 Jul 2017 10:57:17 +0200 Subject: [PATCH] UT for #3542 --- .../multiplayer/MultiplayerTriggerTest.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/multiplayer/MultiplayerTriggerTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/multiplayer/MultiplayerTriggerTest.java b/Mage.Tests/src/test/java/org/mage/test/multiplayer/MultiplayerTriggerTest.java new file mode 100644 index 0000000000..c2d598c72c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/multiplayer/MultiplayerTriggerTest.java @@ -0,0 +1,43 @@ +package org.mage.test.multiplayer; + +import mage.constants.MultiplayerAttackOption; +import mage.constants.PhaseStep; +import mage.constants.RangeOfInfluence; +import mage.constants.Zone; +import mage.game.FreeForAll; +import mage.game.Game; +import mage.game.GameException; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestMultiPlayerBase; + +import java.io.FileNotFoundException; + +public class MultiplayerTriggerTest extends CardTestMultiPlayerBase { + + @Override + protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { + Game game = new FreeForAll(MultiplayerAttackOption.MULTIPLE, RangeOfInfluence.ALL, 0, 40); + // Player order: A -> D -> C -> B + playerA = createPlayer(game, playerA, "PlayerA"); + playerB = createPlayer(game, playerB, "PlayerB"); + playerC = createPlayer(game, playerC, "PlayerC"); + playerD = createPlayer(game, playerD, "PlayerD"); + return game; + } + + @Test + public void testMultiplayerAttackStinkdrinkerBanditTrigger(){ + String pestermite = "Pestermite"; + String stinkdrinker = "Stinkdrinker Bandit"; + addCard(Zone.BATTLEFIELD, playerA, stinkdrinker); + addCard(Zone.BATTLEFIELD, playerA, pestermite, 1); + + attack(1, playerA, pestermite, playerB); + attack(1, playerA, stinkdrinker, playerC); + + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPowerToughness(playerA, pestermite, 4, 2); + } +}