mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
Tests: improved showCardInfo to show texts from multiple card names
This commit is contained in:
parent
ad4be5a9fe
commit
b5f45f395f
2 changed files with 19 additions and 11 deletions
|
@ -280,7 +280,7 @@ public class ThousandYearStormTest extends CardTestPlayerBase {
|
||||||
Cycling {2} ({2}, Discard this card: Draw a card.)
|
Cycling {2} ({2}, Discard this card: Draw a card.)
|
||||||
*/
|
*/
|
||||||
// Test fails sometimes with the following message:
|
// Test fails sometimes with the following message:
|
||||||
// java.lang.AssertionError: b 0x copy after control - PlayerA have wrong life: 20 <> 17 expected:<17> but was:<20>
|
// Can't find available command - activate:Cast Lightning Bolt$targetPlayer=PlayerA
|
||||||
@Test
|
@Test
|
||||||
public void test_GetControlNotCounts() {
|
public void test_GetControlNotCounts() {
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
|
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
|
||||||
|
|
|
@ -967,17 +967,25 @@ public class VerifyCardDataTest {
|
||||||
@Test
|
@Test
|
||||||
public void showCardInfo() throws Exception {
|
public void showCardInfo() throws Exception {
|
||||||
// debug only: show direct card info (takes it from class file, not from db repository)
|
// debug only: show direct card info (takes it from class file, not from db repository)
|
||||||
String cardName = "Essence Capture";
|
// can check multiple cards at once, example: name1;name2;name3
|
||||||
|
String cardNames = "Armed // Dangerous;Beacon Behemoth;Grizzly Bears";
|
||||||
CardScanner.scan();
|
CardScanner.scan();
|
||||||
CardSetInfo testSet = new CardSetInfo(cardName, "test", "123", Rarity.COMMON);
|
Arrays.stream(cardNames.split(";")).forEach(cardName -> {
|
||||||
CardInfo cardInfo = CardRepository.instance.findCard(cardName);
|
cardName = cardName.trim();
|
||||||
Card card = CardImpl.createCard(cardInfo.getClassName(), testSet);
|
CardSetInfo testSet = new CardSetInfo(cardName, "test", "123", Rarity.COMMON);
|
||||||
System.out.println(card.getName());
|
CardInfo cardInfo = CardRepository.instance.findCard(cardName);
|
||||||
if (card instanceof SplitCard) {
|
if (cardInfo == null) {
|
||||||
card.getAbilities().getRules(card.getName()).stream().forEach(System.out::println);
|
Assert.fail("Can't find card name: " + cardName);
|
||||||
} else {
|
}
|
||||||
card.getRules().stream().forEach(System.out::println);
|
Card card = CardImpl.createCard(cardInfo.getClassName(), testSet);
|
||||||
}
|
System.out.println();
|
||||||
|
System.out.println(card.getName() + " " + card.getManaCost().getText());
|
||||||
|
if (card instanceof SplitCard) {
|
||||||
|
card.getAbilities().getRules(card.getName()).stream().forEach(System.out::println);
|
||||||
|
} else {
|
||||||
|
card.getRules().stream().forEach(System.out::println);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkWrongAbilitiesText(Card card, JsonCard ref, int cardIndex) {
|
private void checkWrongAbilitiesText(Card card, JsonCard ref, int cardIndex) {
|
||||||
|
|
Loading…
Reference in a new issue