* Added test for #6291 Unlicensed Disintigration.

This commit is contained in:
LevelX2 2020-06-12 15:48:41 +02:00
parent f480d0bebb
commit fe8a334ffe
2 changed files with 79 additions and 1 deletions

View file

@ -27,7 +27,7 @@ public final class UnlicensedDisintegration extends CardImpl {
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageTargetControllerEffect(3),
new PermanentsOnTheBattlefieldCondition(new FilterControlledArtifactPermanent()),
"If you control an artifact, Unlicensed Disintegration deals 3 damage to that creature's controller"));
"If you control an artifact, {this} deals 3 damage to that creature's controller"));
}

View file

@ -0,0 +1,78 @@
/*
* 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.abilities.oneshot;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class ConditionalOneShotEffectTest extends CardTestPlayerBase {
@Test
public void testDisintegrationWithoutArtifact() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
// Destroy target creature. If you control an artifact, Unlicensed Disintegration deals 3 damage to that creature's controller.
addCard(Zone.HAND, playerA, "Unlicensed Disintegration", 1); // Instant {1}{B}{R}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unlicensed Disintegration", "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
assertGraveyardCount(playerA, "Unlicensed Disintegration", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertLife(playerA, 20);
assertLife(playerB, 20);
}
/**
* Noticed that everytime that i succesfully cast Unlicensed Disintigration
* with an artifact on the board the opponent wont lose 3 life. The creature
* dies but the last piece of text does not work
*/
@Test
public void testDisintegrationWithArtifact() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
// Whenever a player casts a red spell, you may gain 1 life.
addCard(Zone.BATTLEFIELD, playerA, "Dragon's Claw", 1);
// Destroy target creature. If you control an artifact, Unlicensed Disintegration deals 3 damage to that creature's controller.
addCard(Zone.HAND, playerA, "Unlicensed Disintegration", 1); // Instant {1}{B}{R}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unlicensed Disintegration", "Silvercoat Lion");
setChoice(playerA, "Yes"); // Get life from Dragon's Claw
setStopAt(1, PhaseStep.BEGIN_COMBAT);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
assertGraveyardCount(playerA, "Unlicensed Disintegration", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertLife(playerA, 21);
assertLife(playerB, 17);
}
}