Skip to content

🔴 🏦 Technical Test: Written solo in Ruby simulating a simple banking program

Notifications You must be signed in to change notification settings

fwill22/bank-tech-test-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maintainability

Template

Overview: - description and intent of the project - what its for what I did. - description of what the code does

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

Overview

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.

Setup

$ git clone git@github.com:fwill22/bank-tech-test-ruby.git
$ cd bank-tech-test-ruby
$ bundle install
$ irb

How to use

In IRB:

> require ‘./lib/account’
> account = Account.new
> account.deposit(250)
> account.withdraw(150)
> account.print_statement

Testing and Linting

Run Tests

rspec

Results: (to be added)

Run Linting

rubocop

Results: 0 offenses - (to be added)

 

Planning and Approach:

User Stories

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

Edge cases:

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. 

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 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

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:

Dependecies

  • Ruby
  • Rspec
  • Rubocop
  • Simplecov

JavaScript Version

I have also written this test in JS - you can find the repo here.

About

🔴 🏦 Technical Test: Written solo in Ruby simulating a simple banking program

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages