mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Comment (and test!) to demonstrate that current implementation of getEarliestEditionWithAllCards not only has a misleading name, but also doesn't work the way it should!
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package forge.card;
|
||||
|
||||
import forge.deck.CardPool;
|
||||
import forge.item.PaperCard;
|
||||
import forge.model.FModel;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
public class CardEditionCollectionTestCase extends ForgeCardMockTestCase {
|
||||
|
||||
@Test
|
||||
public void getEarliestEditionWithAllCardsNotWorkingAsExpected(){
|
||||
CardEdition.Collection editions = FModel.getMagicDb().getEditions();
|
||||
|
||||
CardDb cardDb = FModel.getMagicDb().getCommonCards();
|
||||
String[] cardNames = {"Shivan Dragon", "Animate Wall", "Balance", "Blessing", "Force of Will"};
|
||||
String[] expectedSets = {"LEA", "LEA", "LEA", "LEA", "ALL"};
|
||||
List<PaperCard> cards = new ArrayList<>();
|
||||
for (int i=0; i < 5; i++){
|
||||
String cardName = cardNames[i];
|
||||
String expectedSet = expectedSets[i];
|
||||
PaperCard card = cardDb.getCardFromEditions(cardName, CardDb.CardArtPreference.OldPrint);
|
||||
assertEquals(card.getEdition(), expectedSet);
|
||||
cards.add(card);
|
||||
}
|
||||
|
||||
CardPool pool = new CardPool();
|
||||
pool.add(cards);
|
||||
CardEdition ed = editions.getEarliestEditionWithAllCards(pool);
|
||||
assertEquals(ed.getCode(), "LEA");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user