public class BankAccount
{
public BankAccount (int customer_id, int initial_balance) {
_customerId = customer_id;
_balance = initial_balance;
}
public int getCustomerId () {
return _customerId;
}
public int getBalance () {
return _balance;
}
/**
* Performs a transaction on the bank account, deducting any transaction
* fees. Transaction may be a deposit, withdrawl, or a change of ownership.
*/
public void apply (Transaction transaction)
{
if (transaction instanceof Deposit)
apply0 ((Deposit) transaction);
else if (transaction instanceof Withdraw)
apply0 ((Withdraw) transaction);
else if (transaction instanceof ChangeOwnership)
apply0 ((ChangeOwnership) transaction);
_balance -= transaction.getTransactionFee ();
}
private int _customerId;
private int _balance;
}
现在,我要在针对这个类生成的testcase中加入数据源。
加入的过程是这样的:
BankAccount(int,int)
input
Arguments
int customer_id=0
int initial_balance={deposit Amount}
Expected output
Outcome
Expected result: Nomal reutrn
BankAccount Outcome is instanceof BankAccount
BankAccount(int, int)
int customer_id=0
int initial_balance={Expected Balance($2 transaction fee)}
Arguments
int customer_id=0
int initial_balance={deposit Amount}
不知道这样的设置是否有错误.