import junit.framework.TestCase;

/**
 * A JUnit test case class.
 * Every method starting with the word "test" will be called when running
 * the test with JUnit.
 */
public class BankAcct1Test extends TestCase
{    
    /**
     * Test the deposit method with a positive amount
     */
    public void testDeposit1()
    {       
        BankAcct1 myAcct = new BankAcct1();
        myAcct.deposit(500);
        
        assertEquals(500, myAcct.getBalance(), 0.001);
    }
    
    /**
     * Test the deposit method with a negative amount
     */
    public void testDeposit2()
    {    
        BankAcct1 myAcct = new BankAcct1();
        myAcct.deposit(-1);
        
        assertEquals(0, myAcct.getBalance(), 0.001);
    }
    
    /**
     * Test the withdraw method with a positive amount
     */
    public void testWithdraw1()
    {    
        BankAcct1 myAcct = new BankAcct1();
        myAcct.withdraw(500);
        
        assertEquals(-500, myAcct.getBalance(), 0.001);
    }
    
    /**
     * Test the withdraw method with a negative amount
     */
    public void testWithdraw2()
    {    
        BankAcct1 myAcct = new BankAcct1();
        myAcct.deposit(-1);
        
        assertEquals(0, myAcct.getBalance(), 0.001);
    }
}
