tests: added automated tests to run all possible dialogs under AI (WIP, part of #13643, improved testable dialogs from #13638);

This commit is contained in:
Oleg Agafonov 2025-06-14 16:20:24 +04:00
parent 6ad2cdaa78
commit 361c320890
19 changed files with 555 additions and 107 deletions

View file

@ -0,0 +1,55 @@
package mage.utils.testers;
import mage.target.Target;
import java.util.List;
/**
* Part of testable game dialogs
*
* @author JayDi85
*/
public class TargetTestableResult extends BaseTestableResult {
Target target = null;
boolean aiAssert = false;
boolean aiMustChooseStatus = false;
int aiMustChooseTargetsCount = 0;
public void save(boolean status, List<String> info, Target target) {
this.save(status, info);
this.target = target;
}
@Override
public boolean isOk() {
if (!this.aiAssert) {
return true;
}
// not finish
if (this.target == null) {
return false;
}
// wrong choose
if (this.getStatus() != this.aiMustChooseStatus) {
return false;
}
// wrong targets
if (this.target.getTargets().size() != this.aiMustChooseTargetsCount) {
return false;
}
// all fine
return true;
}
@Override
public void clear() {
super.clear();
this.target = null;
}
}