mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
Spitemare tests for reported bug
This commit is contained in:
parent
596e2f7f19
commit
4b2c4eb036
1 changed files with 120 additions and 0 deletions
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.mage.test.cards.triggers.damage;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public class SpitemareTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Reported bug: Spitemare's ability isn't dealing damage to creatures.
|
||||
*/
|
||||
@Test
|
||||
public void combatDamageTargetCreature() {
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bronze Sable", 1); // 2/1
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Hill Giant", 1); // 3/3
|
||||
|
||||
/**
|
||||
* {2}{R/W}{R/W}
|
||||
* Creature - Elemental (3/3)
|
||||
* Whenever Spitemare is dealt damage, it deals that much damage to target creature or player.
|
||||
*/
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Spitemare", 1);
|
||||
|
||||
attack(1, playerA, "Bronze Sable");
|
||||
block(1, playerB, "Spitemare", "Bronze Sable");
|
||||
addTarget(playerB, "Hill Giant");
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Bronze Sable", 1);
|
||||
assertGraveyardCount(playerA, "Hill Giant", 1);
|
||||
assertPermanentCount(playerB, "Spitemare", 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reported bug: Spitemare's ability isn't dealing damage to creatures.
|
||||
*/
|
||||
@Test
|
||||
public void nonCombatDamageTargetCreature() {
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Hill Giant", 1); // 3/3
|
||||
addCard(Zone.HAND, playerA, "Lightning Bolt", 1); // {R} deals 3 to target creature/player
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
||||
|
||||
/**
|
||||
* {2}{R/W}{R/W}
|
||||
* Creature - Elemental (3/3)
|
||||
* Whenever Spitemare is dealt damage, it deals that much damage to target creature or player.
|
||||
*/
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Spitemare", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Spitemare");
|
||||
addTarget(playerB, "Hill Giant");
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Lightning Bolt", 1);
|
||||
assertGraveyardCount(playerA, "Hill Giant", 1);
|
||||
assertGraveyardCount(playerB, "Spitemare", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void combatDamageTargetPlayer() {
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bronze Sable", 1); // 2/1
|
||||
|
||||
/**
|
||||
* {2}{R/W}{R/W}
|
||||
* Creature - Elemental (3/3)
|
||||
* Whenever Spitemare is dealt damage, it deals that much damage to target creature or player.
|
||||
*/
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Spitemare", 1);
|
||||
|
||||
attack(1, playerA, "Bronze Sable");
|
||||
block(1, playerB, "Spitemare", "Bronze Sable");
|
||||
addTarget(playerB, playerA);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Bronze Sable", 1);
|
||||
assertPermanentCount(playerB, "Spitemare", 1);
|
||||
assertLife(playerA, 18);
|
||||
assertLife(playerB, 20);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nonCombatDamageTargetPlayer() {
|
||||
|
||||
addCard(Zone.HAND, playerA, "Lightning Bolt", 1); // {R} deals 3 to target creature/player
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
||||
|
||||
/**
|
||||
* {2}{R/W}{R/W}
|
||||
* Creature - Elemental (3/3)
|
||||
* Whenever Spitemare is dealt damage, it deals that much damage to target creature or player.
|
||||
*/
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Spitemare", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Spitemare");
|
||||
addTarget(playerB, playerA);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Lightning Bolt", 1);
|
||||
assertGraveyardCount(playerB, "Spitemare", 1);
|
||||
assertLife(playerA, 17);
|
||||
assertLife(playerB, 20);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue