diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java b/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java index 2291e16200..eb6dbc1fed 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java @@ -177,7 +177,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid { String key1 = cv.getName() + cv.getExpansionSetCode() + cv.getCardNumber(); for (CardView cardView : cards.values()) { String key2 = cardView.getName() + cardView.getExpansionSetCode() + cardView.getCardNumber(); - if ((key1).equals(key2)) { + if (key1.equals(key2)) { view.set(j, cardView); break; } diff --git a/Mage.Client/src/test/java/mage/client/util/CardHelperTest.java b/Mage.Client/src/test/java/mage/client/util/CardHelperTest.java new file mode 100644 index 0000000000..6e6a3b3be1 --- /dev/null +++ b/Mage.Client/src/test/java/mage/client/util/CardHelperTest.java @@ -0,0 +1,27 @@ +package mage.client.util; + +import mage.client.deckeditor.table.CardHelper; +import mage.constants.CardType; +import mage.view.CardView; +import org.junit.Assert; +import org.junit.Test; + +import static org.hamcrest.core.Is.is; + +/** + * Created by IGOUDT on 3-3-2017. + */ +public class CardHelperTest { + + @Test + public void testCardTypeOrder() { + CardView v = new CardView(true); + v.getCardTypes().add(CardType.CREATURE); + v.getCardTypes().add(CardType.ARTIFACT); + String cardtypeText = CardHelper.getType(v); + Assert.assertThat(cardtypeText, is("Artifact Creature")); + + } + + +}