Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
arquillos opened this issue Aug 17, 2019 · 1 comment
Open

Comments

@arquillos
Copy link

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

/** * 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 {

@aaron-goff
Copy link

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);
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants