From 97e5f6aa16010715f0569b49d12491e9510e0f9f Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sun, 25 Mar 2012 23:16:24 +0400 Subject: [PATCH] Added test that reproduces issue with Oblivion Ring second ability --- .../test/cards/triggers/OblivionRingTest.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java new file mode 100644 index 00000000000..028456eb09d --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java @@ -0,0 +1,52 @@ +package org.mage.test.cards.triggers; + +import mage.Constants; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestBase; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author noxx + * + * Card: When Mausoleum Guard dies, put two 1/1 white Spirit creature tokens with flying onto the battlefield. + */ +public class OblivionRingTest extends CardTestPlayerBase { + + @Test + public void testFirstTriggeredAbility() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 3); + addCard(Constants.Zone.HAND, playerA, "Oblivion Ring"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring"); + + setStopAt(2, Constants.PhaseStep.END_TURN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + assertPermanentCount(playerA, "Oblivion Ring", 1); + assertPermanentCount(playerB, "Frost Titan", 0); + } + + @Test + public void testSecondTriggeredAbility() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 3); + addCard(Constants.Zone.HAND, playerA, "Oblivion Ring"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm"); + + addCard(Constants.Zone.BATTLEFIELD, playerB, "Forest", 2); + addCard(Constants.Zone.HAND, playerB, "Naturalize"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring"); + castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Naturalize", "Oblivion Ring"); + + setStopAt(2, Constants.PhaseStep.END_TURN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + assertPermanentCount(playerA, "Oblivion Ring", 0); + assertPermanentCount(playerB, "Frost Titan", 1); + } +}