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:
leriomaggio
2021-08-26 02:47:35 +01:00
parent fed48e01c2
commit 3acf7384e3
3 changed files with 18 additions and 1 deletions

View File

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

View File

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