Tests: improved verify tests:

- added checks for duplicated indefinite articles in the rules;
 - improved test_showCardInfo - now it can search cards by simple class name too;
 - fixed some card/token texts;
This commit is contained in:
Oleg Agafonov 2023-04-30 18:49:22 +04:00
parent e848f85e81
commit 255a050025
6 changed files with 42 additions and 26 deletions

View file

@ -359,11 +359,6 @@ public enum CardRepository {
return findPreferredOrLatestCard(cards, preferredSetCode);
}
public CardInfo findPreferredCoreExpansionCardByClassName(String canonicalClassName, String preferredSetCode) {
List<CardInfo> cards = findCardsByClass(canonicalClassName);
return findPreferredOrLatestCard(cards, preferredSetCode);
}
private CardInfo findPreferredOrLatestCard(List<CardInfo> cards, String preferredSetCode) {
if (!cards.isEmpty()) {
Date lastReleaseDate = null;

View file

@ -54,6 +54,11 @@ public abstract class TokenImpl extends MageObjectImpl implements Token {
public TokenImpl(String name, String description) {
this.name = name;
this.description = description;
// verify check: indefinite article
if (description.startsWith("a ") || description.startsWith("an ")) {
throw new IllegalArgumentException("Wrong code usage: don't use indefinite article here - " + description);
}
}
protected TokenImpl(final TokenImpl token) {

View file

@ -17,7 +17,7 @@ public final class ZombieKnightToken extends TokenImpl {
}
public ZombieKnightToken(){
super("Zombie Knight Token", "a 2/2 black Zombie Knight creature token with menace");
super("Zombie Knight Token", "2/2 black Zombie Knight creature token with menace");
availableImageSetCodes = tokenImageSets;
color.setBlack(true);
cardType.add(CardType.CREATURE);