forked from External/mage
This commit is contained in:
parent
a47c5726ec
commit
b66912ea44
3 changed files with 67 additions and 22 deletions
|
|
@ -10,21 +10,45 @@ import java.util.List;
|
|||
*/
|
||||
public class MultiAmountTestableResult extends BaseTestableResult {
|
||||
|
||||
List<Integer> values = new ArrayList<>();
|
||||
List<Integer> selectedValues;
|
||||
|
||||
public void onFinish(String resDebugSource, boolean status, List<String> info, List<Integer> values) {
|
||||
boolean aiAssertEnabled = false;
|
||||
List<Integer> aiAssertValues = new ArrayList<>();
|
||||
|
||||
public void onFinish(String resDebugSource, boolean status, List<String> info, List<Integer> selectedValues) {
|
||||
this.onFinish(resDebugSource, status, info);
|
||||
this.values = values;
|
||||
this.selectedValues = selectedValues;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResAssert() {
|
||||
return null; // TODO: implement
|
||||
if (!this.aiAssertEnabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// not finished
|
||||
if (this.selectedValues == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// wrong selection
|
||||
String selected = this.selectedValues.toString();
|
||||
String need = this.aiAssertValues.toString();
|
||||
|
||||
if (!selected.equals(need)) {
|
||||
return String.format("Wrong selection: need %s, but get %s",
|
||||
need,
|
||||
selected
|
||||
);
|
||||
}
|
||||
|
||||
// all fine
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClear() {
|
||||
super.onClear();
|
||||
this.values.clear();
|
||||
this.selectedValues = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue