我尝试对我的方法进行JUNIT测试,但我无法得到任何结果。
public int withDrowMoney() {
enterAmount = scann.nextInt();
if (enterAmount <= 10) {
throw new IllegalArgumentException("Your enterAmount is too low");
} else if (enterAmount >= 10000) {
throw new IllegalArgumentException("Your enterAmount is too high");
} else if (enterAmount % 100 != 0) {
throw new IllegalArgumentException("You must take 100 200 and so on");
} else if (inMemoryAtm.getAllLastWithDrow().isEmpty()) {
NEWBALANCE = account.getAccountBalance() - enterAmount;
inMemoryAccount.saveNewBalance(NEWBALANCE);
} else {
NEWBALANCE = inMemoryAccount.getSaveNewBalance().get(0) - enterAmount;
inMemoryAccount.saveNewBalance(NEWBALANCE);
}
inMemoryAtm.saveLastWithDrow(enterAmount);
return NEWBALANCE;
}