Skip to content

cfujiname/bank-tech-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bank Tech Test

Practice OO and TDD

Implementation

  • Analise the acceptance criteria and structure the process through diagramming

Acceptance Criteria

Given a client makes a deposit of 1000 on 10-01-2012 And a deposit of 2000 on 13-01-2012 And a withdrawal of 500 on 14-01-2012 When she prints her bank statement Then she would see

date || credit || debit || balance

14/01/2012 || || 500.00 || 2500.00

13/01/2012 || 2000.00 || || 3000.00

10/01/2012 || 1000.00 || || 1000.00

  • it is in reversed chronological order

Structuring process

  • A bank account can do (super class):
    • deposit, withdrawal, print statement of transactions
  • A transaction (sub class) can be either a deposit or a withdrawal
  • Printing statement (sub class) contains history of transactions
  • All transactions contain date

Class Transactions

  • should have a default balance of 0
  • has deposit method
  • has withdrawal method (user should not be allowed to withdraw more than balace permits - edge case)
  • has a list of transactions
  • has dates of each transaction

Class Statement

  • has the list of transactions to print (depends on Transactions class)
  • prints the list of transactions

Class Bank Account

<< Transaction (deposit/withdrawal)

<< Statement

  • orchestrates the methods from Transactions and Statement
  • has transactions on itself (initialised)
  • can call the methods deposit and withdraw
  • can print statements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published