import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; /** * The test class DepositAccountTest. * * @author (your name) * @version (a version number or a date) */ public class DepositAccountTest { @Test public void withdrawTest(){ DepositAccount test = new DepositAccount(1000, 0.1D); try{test.withdraw(100);} catch(AccountException ae){}; assertTrue(test.balance() == 900); } @Test public void updateTest(){ DepositAccount test = new DepositAccount(1000, 0.1D); test.update(); assertTrue(test.balance() == 1100); } @Test public void setIntrestTest(){ DepositAccount test = new DepositAccount(1000, 0.1D); test.setInterest(0.05D); test.update(); assertTrue(test.balance() == 1050); } }