TestAutomationU / unit-testing

Code from course "Testing From The Inside: Unit Testing Edition" by Tariq King on Test Automation University
11 stars 34 forks source link

Test file: SavingsAccountTest.java is not complete (master branch) #1

Open arquillos opened 5 years ago

arquillos commented 5 years ago

The file: SavingsAccountTest.java is not complete. The last test method is not "done":

`/**

aaron-goff commented 4 years ago

This was added to chapter5/bankService/SavingsAccountTest.java in #2 but not to chapter4/bankService/SavingsAccountTest.java.

    /**
     *  Customers should not be able to withdraw more than their available savings account balance
     *  Scenario:
     *  1. Given a customer's savings account with an initial balance of $100.00
     *  2. When I attempt to withdraw $200.00
     *  3. Then an exception should occur indicating that there are insufficient funds in the account
     *  4. And the account balance should remain unchanged.
     */
    @Test
    public void withdrawingAmountGreaterThanBalance_Throws_InsufficientFundsException() throws InsufficientFundsException {
       try {
            savings.withdraw(200.00);
            fail("Expected Insufficient Funds Exception but none is thrown");
        } catch (InsufficientFundsException e){
            // Then
            assertEquals(savings.getBalance(), 100.00);
        }
    }
}