mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
added unit test
This commit is contained in:
parent
a0930e3379
commit
6b20d352ca
2 changed files with 28 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue