Setup instructions/guide (how to setup or install)
-
How to run it
-
How to run tests
-
Dependencies information
-
demo of how to use program (gif)
Planning and Approach:
- User stories
- The domain model
- CRC cards
- Process
Other:
- Build passing (travis/circle CI)
- Test coverage (auto generated)
- Code style and code conventions (linting)
- code climate
Solo project to solve a technical challenge with a focus on clean well crafted code. Program allows user to manage finances through a simple command line interface.
$ git clone [email protected]:fwill22/bank-tech-test-ruby.git
$ cd bank-tech-test-ruby
$ bundle install
$ irb
In IRB:
> require ‘./lib/account’
> account = Account.new
> account.deposit(250)
> account.withdraw(150)
> account.print_statement
rspec
Results: (to be added)
rubocop
Results: 0 offenses - (to be added)
As a user
So I can be part of a cashless economy
I want to be able to open an empty bank account
As a user
So I can store my money securely
I want to be able to deposit it into my account
As a user
So I can buy things untracked
I want to be able to withdraw money from my account
As a user
So I can check how much money I have saved
I want to be able to see my current account balance and transaction history on a printed statement.
As a user
So I can keep on top of my money habits
I want my account statement to display the date, transaction amount, type, and updated balance.
As a user
So I can see an up to date history of my transactions
I want to be able to see my account statement listed in reverse chronology by date created
As a user
So I can stay in the black
I want my account to prevent withdrawal if I have insufficient funds
As a bank manager
So I can ensure the efficient operation of my business
I want to be able to notify customers if they are depositing or withdrawing amounts ≤ £0.
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 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 |
CRC Cards
[Draft]Account:
Responsibilities:
Knows about:
Starting balance of 0
Current balance
History of transactions
Can add deposited money to CB
Can subtract withdrawn money from CB
Collaborators:
Transaction
Statement
Transaction:
Responsibilities:
Knows about:
Credit amount transaction is for
Debit amount transaction is for
Date created
Format for printing line on statement
Collaborators: Statement
Statement:
Responsibilities:
Knows about:
Transaction history
Current balance
Collaborators: -
CLASS:
Responsibilities: | Collaborators: |
---|---|
Knows about: |
- Ruby
- Rspec
- Rubocop
- Simplecov
I have also written this test in JS - you can find the repo here.