From e87db19b7dc7f790d7aab3cdded369c4b0fe482f Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 29 Dec 2017 17:10:07 +0400 Subject: [PATCH] Tests: fixed NykthosShrineToNyx that broke dozens of other tests with mana choice --- .../src/mage/cards/n/NykthosShrineToNyx.java | 2 +- .../main/java/mage/choices/ChoiceColor.java | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Mage.Sets/src/mage/cards/n/NykthosShrineToNyx.java b/Mage.Sets/src/mage/cards/n/NykthosShrineToNyx.java index ac2ea819797..c6031c4c90c 100644 --- a/Mage.Sets/src/mage/cards/n/NykthosShrineToNyx.java +++ b/Mage.Sets/src/mage/cards/n/NykthosShrineToNyx.java @@ -94,7 +94,7 @@ class NykthosShrineToNyxManaAbility extends ActivatedManaAbilityImpl { public List getNetMana(Game game) { netMana.clear(); if (game != null) { - for (String colorChoice : ChoiceColor.colorChoices) { + for (String colorChoice : ChoiceColor.getBaseColors()) { netMana.add(((NykthosDynamicManaEffect) this.getEffects().get(0)).computeMana(colorChoice, game, this)); } } diff --git a/Mage/src/main/java/mage/choices/ChoiceColor.java b/Mage/src/main/java/mage/choices/ChoiceColor.java index 6f7255a729a..2eedbdf0d46 100644 --- a/Mage/src/main/java/mage/choices/ChoiceColor.java +++ b/Mage/src/main/java/mage/choices/ChoiceColor.java @@ -37,19 +37,20 @@ import java.util.Set; /** * - * @author BetaSteward_at_googlemail.com + * @author BetaSteward_at_googlemail.com, JayDi85 */ public class ChoiceColor extends ChoiceImpl { - //public static final Set colorChoices = new HashSet<>(); // JayDi85: uncomment 1 of 2 to broke unit tests find wrong tests (?) - public static final ArrayList colorChoices = new ArrayList<>(); + private static final ArrayList colorChoices = getBaseColors(); - static { - colorChoices.add("Green"); - colorChoices.add("Blue"); - colorChoices.add("Black"); - colorChoices.add("Red"); - colorChoices.add("White"); + public static ArrayList getBaseColors(){ + ArrayList arr = new ArrayList<>(); + arr.add("Green"); + arr.add("Blue"); + arr.add("Black"); + arr.add("Red"); + arr.add("White"); + return arr; } public ChoiceColor() { @@ -72,7 +73,6 @@ public class ChoiceColor extends ChoiceImpl { super(required); this.choices.addAll(colorChoices); - //this.setChoices(colorChoices); // JayDi85: uncomment 2 of 2 to broke unit tests find wrong tests (?) this.setMessage(chooseMessage); this.setSubMessage(chooseSubMessage);