Skip to content

Withdraw money from an account #3

@huangweili97

Description

@huangweili97

As an existing bank customer with an account, I want to withdraw money from my account, so that I can use my funds for expenses.

Acceptance Criteria

Scenario 1: Successful withdrawal
Given the user has an active bank account with sufficient balance,
When they provide the correct account ID and a valid withdrawal amount,
Then the balance of the account is decreased by the withdrawn amount.

Scenario 2: Unsuccessful withdrawal due to insufficient funds
Given the user has an active bank account but an insufficient balance,
When they attempt to withdraw an amount greater than the balance,
Then the system does not process the withdrawal and an error message is displayed.

Scenario 3: Unsuccessful withdrawal due to invalid account ID
Given the user provides an invalid or non-existent account ID,
When they attempt to withdraw money,
Then the system does not process the withdrawal and an error message is displayed.

Scenario 4: Unsuccessful withdrawal due to invalid amount
Given the user has an active bank account,
When they attempt to withdraw a zero or negative amount,
Then the system does not process the withdrawal and an error message is displayed.

Tasks

  1. Add a method for withdrawing money from an account in the Bank class.
  2. Ensure the method validates the account ID, withdrawal amount, and account balance before processing.
  3. Create unit tests to verify all acceptance criteria.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions