added unit test

This commit is contained in:
ingmargoudt 2017-03-03 22:28:34 +01:00
parent a0930e3379
commit 6b20d352ca
2 changed files with 28 additions and 1 deletions

View file

@ -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;
}

View file

@ -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"));
}
}