Move useRedDefault() method to only test which uses it (#9104)

Co-authored-by: DeepCrimson <deepcrimson@users.noreplyl.github.com>
Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
DeepCrimson 2022-06-16 21:55:53 -07:00 committed by GitHub
parent 90fedddc92
commit e1cf2fd7e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 69 deletions

View file

@ -1,6 +1,5 @@
package org.mage.test.serverside.base; package org.mage.test.serverside.base;
import java.util.List;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.constants.PhaseStep; import mage.constants.PhaseStep;
import mage.constants.Zone; import mage.constants.Zone;
@ -8,6 +7,8 @@ import mage.filter.Filter;
import mage.players.Player; import mage.players.Player;
import org.mage.test.player.TestPlayer; import org.mage.test.player.TestPlayer;
import java.util.List;
/** /**
* Interface for all test initialization and assertion operations. * Interface for all test initialization and assertion operations.
*/ */
@ -23,13 +24,6 @@ public interface CardTestAPI {
DRAW DRAW
} }
//******* INITIALIZATION METHODS *******/
/**
* Default game initialization params for red player (that plays with
* Mountains)
*/
void useRedDefault();
/** /**
* Removes all cards from player's library from the game. Usually this * Removes all cards from player's library from the game. Usually this
* should be used once before initialization to form the library in certain * should be used once before initialization to form the library in certain

View file

@ -24,33 +24,6 @@ import java.util.UUID;
* @author ayratn * @author ayratn
*/ */
public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAPI { public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAPI {
/**
* Default game initialization params for red player (that plays with Mountains)
*/
@Override
public void useRedDefault() {
// *** ComputerA ***
// battlefield:ComputerA:Mountain:5
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
// hand:ComputerA:Mountain:4
addCard(Zone.HAND, playerA, "Mountain", 5);
// library:ComputerA:clear:0
removeAllCardsFromLibrary(playerA);
// library:ComputerA:Mountain:10
addCard(Zone.LIBRARY, playerA, "Mountain", 10);
// *** ComputerB ***
// battlefield:ComputerB:Plains:2
addCard(Zone.BATTLEFIELD, playerB, "Plains", 2);
// hand:ComputerB:Plains:2
addCard(Zone.HAND, playerB, "Plains", 2);
// library:ComputerB:clear:0
removeAllCardsFromLibrary(playerB);
// library:ComputerB:Plains:10
addCard(Zone.LIBRARY, playerB, "Plains", 10);
}
/** /**
* Removes all cards from player's library from the game. * Removes all cards from player's library from the game.
* Usually this should be used once before initialization to form the library in certain order. * Usually this should be used once before initialization to form the library in certain order.

View file

@ -156,33 +156,6 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
} }
} }
/**
* Default game initialization params for red player (that plays with
* Mountains)
*/
@Override
public void useRedDefault() {
// *** ComputerA ***
// battlefield:ComputerA:Mountain:5
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
// hand:ComputerA:Mountain:4
addCard(Zone.HAND, playerA, "Mountain", 5);
// library:ComputerA:clear:0
removeAllCardsFromLibrary(playerA);
// library:ComputerA:Mountain:10
addCard(Zone.LIBRARY, playerA, "Mountain", 10);
// *** ComputerB ***
// battlefield:ComputerB:Plains:2
addCard(Zone.BATTLEFIELD, playerB, "Plains", 2);
// hand:ComputerB:Plains:2
addCard(Zone.HAND, playerB, "Plains", 2);
// library:ComputerB:clear:0
removeAllCardsFromLibrary(playerB);
// library:ComputerB:Plains:10
addCard(Zone.LIBRARY, playerB, "Plains", 10);
}
/** /**
* @throws GameException * @throws GameException
* @throws FileNotFoundException * @throws FileNotFoundException

View file

@ -2,6 +2,7 @@ package org.mage.test.serverside.cards.abilities;
import mage.constants.PhaseStep; import mage.constants.PhaseStep;
import mage.constants.Zone; import mage.constants.Zone;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase; import org.mage.test.serverside.base.CardTestPlayerBase;
@ -10,11 +11,33 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*/ */
public class ProtectionFromTypeTest extends CardTestPlayerBase { public class ProtectionFromTypeTest extends CardTestPlayerBase {
@Before
public void setUp() {
// *** ComputerA ***
// battlefield:ComputerA:Mountain:5
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
// hand:ComputerA:Mountain:4
addCard(Zone.HAND, playerA, "Mountain", 5);
// library:ComputerA:clear:0
removeAllCardsFromLibrary(playerA);
// library:ComputerA:Mountain:10
addCard(Zone.LIBRARY, playerA, "Mountain", 10);
// *** ComputerB ***
// battlefield:ComputerB:Plains:2
addCard(Zone.BATTLEFIELD, playerB, "Plains", 2);
// hand:ComputerB:Plains:2
addCard(Zone.HAND, playerB, "Plains", 2);
// library:ComputerB:clear:0
removeAllCardsFromLibrary(playerB);
// library:ComputerB:Plains:10
addCard(Zone.LIBRARY, playerB, "Plains", 10);
// Trigon of Corruption enters the battlefield with three charge counters on it.
addCard(Zone.BATTLEFIELD, playerA, "Trigon of Corruption");
}
@Test @Test
public void testProtectionFromArtifacts() { public void testProtectionFromArtifacts() {
useRedDefault();
addCard(Zone.BATTLEFIELD, playerA, "Trigon of Corruption");
addCard(Zone.BATTLEFIELD, playerB, "Tel-Jilad Fallen"); addCard(Zone.BATTLEFIELD, playerB, "Tel-Jilad Fallen");
checkPlayableAbility("before", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Remove", false); checkPlayableAbility("before", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Remove", false);
@ -27,10 +50,6 @@ public class ProtectionFromTypeTest extends CardTestPlayerBase {
@Test @Test
public void testNoProtection() { public void testNoProtection() {
useRedDefault();
// Trigon of Corruption enters the battlefield with three charge counters on it.
addCard(Zone.BATTLEFIELD, playerA, "Trigon of Corruption");
addCard(Zone.BATTLEFIELD, playerB, "Coral Merfolk"); addCard(Zone.BATTLEFIELD, playerB, "Coral Merfolk");
setStrictChooseMode(true); setStrictChooseMode(true);