From 35ae9e316ef2bb44a7347af66b89b09e7d5009f6 Mon Sep 17 00:00:00 2001 From: igoudt Date: Fri, 2 Jun 2017 17:27:36 +0200 Subject: [PATCH] test manatype on enum, not on string --- .../test/cards/mana/DoublingCubeTest.java | 3 ++- .../base/impl/CardTestPlayerAPIImpl.java | 19 ++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/DoublingCubeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/DoublingCubeTest.java index e659f324a2..19b042b09d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/DoublingCubeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/DoublingCubeTest.java @@ -1,6 +1,7 @@ package org.mage.test.cards.mana; import mage.abilities.costs.mana.ColorlessManaCost; +import mage.constants.ManaType; import mage.constants.PhaseStep; import mage.constants.Zone; import org.junit.Test; @@ -35,7 +36,7 @@ public class DoublingCubeTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.PRECOMBAT_MAIN); execute(); - assertManaPool(playerA, "colorless", 4); + assertManaPool(playerA, ManaType.COLORLESS, 4); } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index f550889536..026a5052fc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -8,10 +8,7 @@ import mage.cards.decks.importer.DeckImporterUtil; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; import mage.cards.repository.CardScanner; -import mage.constants.CardType; -import mage.constants.PhaseStep; -import mage.constants.RangeOfInfluence; -import mage.constants.Zone; +import mage.constants.*; import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.FilterCard; @@ -836,25 +833,25 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } - public void assertManaPool(Player player, String color, int amount){ + public void assertManaPool(Player player, ManaType color, int amount){ ManaPool manaPool = currentGame.getPlayer(player.getId()).getManaPool(); switch (color){ - case "colorless": + case COLORLESS: Assert.assertEquals(manaPool.getColorless() + manaPool.getConditionalMana().stream().mapToInt(Mana::getColorless).sum(), amount); break; - case "red": + case RED: Assert.assertEquals(manaPool.getRed() + manaPool.getConditionalMana().stream().mapToInt(Mana::getRed).sum(), amount); break; - case "blue": + case BLUE: Assert.assertEquals(manaPool.getBlue() + manaPool.getConditionalMana().stream().mapToInt(Mana::getBlue).sum(), amount); break; - case "white": + case WHITE: Assert.assertEquals(manaPool.getWhite() + manaPool.getConditionalMana().stream().mapToInt(Mana::getWhite).sum(), amount); break; - case "green": + case GREEN: Assert.assertEquals(manaPool.getGreen() + manaPool.getConditionalMana().stream().mapToInt(Mana::getGreen).sum(), amount); break; - case "black": + case BLACK: Assert.assertEquals(manaPool.getBlack() + manaPool.getConditionalMana().stream().mapToInt(Mana::getBlack).sum(), amount); break; }