Git Product home page Git Product logo

oo-banking-v-000's Introduction

Object Oriented Banking

Objective

  1. Use TDD to code two classes that interact with each other.

Description

We're going to build a BankAccount class where one instance of the class can transfer money to another instance through a Transfer class. The Transfer class acts as a space for a transaction between two instances of the bank account class. Think of it this way: you can't just transfer money to another account without the bank running checks first. Transfer instances will do all of this, as well as check the validity of the accounts before the transaction occurs. Transfer instances should be able to reject a transfer if the accounts aren't valid or if the sender doesn't have the money.

Transfers start out in a "pending" status. They can be executed and go to a "complete" state. They can also go to a "rejected" status. A completed transfer can also be reversed and go into a "reversed" status.

Instructions

Pass the tests. They are deliberatively vague; your design is up to you! Read the test output and test files very carefully to get through this one.

View OO Banking on Learn.co and start learning to code for free.

oo-banking-v-000's People

Contributors

ahimmelstoss avatar deniznida avatar drakeltheryuujin avatar fislabstest avatar fs-lms-test-bot avatar jenmyers avatar kode-tiki avatar kthffmn avatar maxwellbenton avatar pletcher avatar sarogers avatar sophiedebenedetto avatar vibraniumforge avatar victhevenot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oo-banking-v-000's Issues

the second test for the both_valid? method requires extra (seemingly unnecessary) code to pass

The following test:
it "calls on the sender and reciever's #valid? methods" do
transfer_class = File.read("lib/transfer.rb")
expect(transfer_class.scan(/sender.valid? && receiver.valid?/).length).to eq 1
end

doesn't pass with the following code, which performs the required functionality properly in 1 line of code:
def both_valid?
@sender.valid? && @receiver.valid?
end

the following adjustment to the test would allow the above code to pass:
it "calls on the sender and reciever's #valid? methods" do
transfer_class = File.read("lib/transfer.rb")
expect(transfer_class.scan(/@sender.valid? && @receiver.valid?/).length).to eq 1
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.