Added a test.

This commit is contained in:
LevelX2 2015-07-20 12:28:30 +02:00
parent caa9794e6b
commit 597d1ab832
2 changed files with 39 additions and 16 deletions

View file

@ -1,16 +1,16 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
@ -20,20 +20,19 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2011;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.Mana;
import mage.abilities.effects.common.BasicManaEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
@ -45,6 +44,7 @@ public class PyreticRitual extends CardImpl {
super(ownerId, 153, "Pyretic Ritual", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}");
this.expansionSetCode = "M11";
// Add {R}{R}{R} to your mana pool.
this.getSpellAbility().addEffect(new BasicManaEffect(Mana.RedMana(3)));
}

View file

@ -8,7 +8,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* also tests cost reduction effects
*
*
* @author BetaSteward
*/
public class CostModificationTest extends CardTestPlayerBase {
@ -46,16 +46,12 @@ public class CostModificationTest extends CardTestPlayerBase {
}
/**
* Test that cost reduction also works with mana source restriction
* Myr Superion
* Spend only mana produced by creatures to cast Myr Superion
* Test that cost reduction also works with mana source restriction Myr
* Superion Spend only mana produced by creatures to cast Myr Superion
*
* Etherium Sculptor {1}{U}
* Artifact Creature - Vedalken Artificer
* 1/2
* Etherium Sculptor {1}{U} Artifact Creature - Vedalken Artificer 1/2
* Artifact spells you cast cost {1} less to cast.
*/
@Test
public void testCostReductionWithManaSourceRestrictionWorking() {
// Artifact spells you cast cost {1} less to cast
@ -95,4 +91,31 @@ public class CostModificationTest extends CardTestPlayerBase {
assertHandCount(playerA, "Myr Superion", 1); // Can't be cast because mana was not produced by a creature
}
/*
I had Goblin Electromancer, but somehow Pyretic Ritual wasn't cheaper howeverDesperate Ritual was.
*/
@Test
public void testCostReductionForPyreticRitual() {
// Instant and sorcery spells you cast cost {1} less to cast.
addCard(Zone.BATTLEFIELD, playerA, "Goblin Electromancer");
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
// Add {R}{R}{R} to your mana pool.
addCard(Zone.HAND, playerA, "Pyretic Ritual");
// Fated Conflagration deals 5 damage to target creature or planeswalker.
// If it's your turn, scry 2. (Look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.)
addCard(Zone.HAND, playerA, "Fated Conflagration");
addCard(Zone.BATTLEFIELD, playerB, "Carnivorous Moss-Beast"); // 4/5
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pyretic Ritual");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fated Conflagration", "Carnivorous Moss-Beast");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Pyretic Ritual", 1);
assertGraveyardCount(playerA, "Fated Conflagration", 1);
assertGraveyardCount(playerB, "Carnivorous Moss-Beast", 1);
}
}