tests: added tests for auto-lands suggestion in deck editor and tourney (related to #13127)

This commit is contained in:
Oleg Agafonov 2024-12-16 21:42:38 +04:00
parent 40e2cf7cda
commit 2955535927
4 changed files with 180 additions and 21 deletions

View file

@ -87,7 +87,7 @@ public class AddLandDialog extends MageDialog {
landSetNames.add(expansionInfo.getName());
}
if (landSetNames.isEmpty()) {
throw new IllegalArgumentException("No set with basic land was found");
throw new IllegalArgumentException("No set with basic land was found (possible memory problems, need client restart)");
}
if (landSetNames.size() > 1) {
landSetNames.add("<Random lands>");
@ -477,6 +477,7 @@ public class AddLandDialog extends MageDialog {
}//GEN-LAST:event_btnSetFastSearchActionPerformed
private void autoAddLands() {
// suggest lands amount for deck without lands
int deckSize = ((Number) spnDeckSize.getValue()).intValue();
int[] lands = DeckBuildUtils.landCountSuggestion(deckSize, deck.getMaindeckCards());
spnPlains.setValue(lands[0]);