mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
FIXED Sneaky bug that capped art index in DB requests to one digit!
(Added tests in cardDb and CardRequest to cover the case!)
This commit is contained in:
@@ -142,7 +142,7 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
|
||||
}
|
||||
|
||||
private static boolean isArtIndex(String s) {
|
||||
return StringUtils.isNumeric(s) && s.length() == 1;
|
||||
return StringUtils.isNumeric(s);
|
||||
}
|
||||
|
||||
private static boolean isSetCode(String s) {
|
||||
|
||||
@@ -2079,6 +2079,12 @@ public class CardDbTestCase extends ForgeCardMockTestCase {
|
||||
assertEquals(islandOriginal.getArtIndex(), 12);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMaxArtCountForBasicLand(){
|
||||
int maxArtIndex = this.cardDb.getMaxArtIndex("Island");
|
||||
assertEquals(maxArtIndex, 13);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -215,4 +215,15 @@ public class CardRequestTestCase {
|
||||
assertNotEquals(request.artIndex, newRequest.artIndex);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingCardRequestWithArtIndexGreaterThanNine(){
|
||||
String requestString = CardRequest.compose("Island", "SLD", 13);
|
||||
CardRequest request = CardRequest.fromString(requestString);
|
||||
|
||||
assertEquals(request.cardName, "Island");
|
||||
assertEquals(request.edition, "SLD");
|
||||
assertEquals(request.artIndex, 13);
|
||||
assertEquals(request.collectorNumber, IPaperCard.NO_COLLECTOR_NUMBER);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user