Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bank Account #32

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Bank Account #32

wants to merge 22 commits into from

Conversation

botrethewey
Copy link

Bank Account

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Why is it useful to put classes inside modules? What do you think? Using classes inside the Bank module was very useful in this project, because multiple classes have the exact same name for certain methods/ class attributes. Using modules make it very clear which method is being called for that instance of a class.
What is accomplished with raise ArgumentError? What do you think it's doing? It exits the program and displays an error message.
Why do you think we made the .all & .find methods class methods? Why not instance methods? It made sense because we needed to access all of the instances of the class. If these methods were not class methods, then it would be impossible to track all of its instances. As a instance method, they can not access other instances.
Why does it make sense to use inheritance for the different types of accounts? It made sense to make the saving account and the checking account be a subclass of the account , since both classes are build on the same characteristics of the account class. The money market class is a sub class of the savings account since money market account uses the same add_interest method in savings account in addition to sharing characteristics.
Did the presence of automated tests change the way you thought about the problem? How? Yes, It was helpful to build a code with having road map of where the potential problems might arise. Also it was helpful in finding syntax errors in the code.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall well done, there are some methods that are too long and complicated (finding owners for example). You should have taken some advantage of inheritance (super) and you're missing some things in your testing.

Despite this you did a very good job on testing and good work on the extras. Nice work!

@open_date = DateTime.parse(open_date)

# Assumes that required csv file is accesible
CSV.read("support/account_owners.csv").each do |line|

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop is problematic. It's reading the file and each find is reading another file each time. The find methods should probably be scanning through the Arrays provided by .all so you don't have to repeat things over and over again.

describe "#initialize" do
# Check that a CheckingAccount is in fact a kind of account
it "Is a kind of Account" do
account = Bank::CheckingAccount.new(12345, 100.0)
account = Bank::CheckingAccount.new(12345, 10000, "1999-03-27 11:30:09 -0800")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This are some really good tests.


# Balance does not change, returns amount
it "Doesn't modify the balance if the fee would put it below $0.00" do
Bank::CheckingAccount.new(12345, 10000, "1999-03-27 11:30:09 -0800").withdraw(100000).must_equal 10000
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above two tests should check to ensure the balance doesn't get modified like:

my_checking_acct = Bank::CheckingAccount.new(12345, 10000, "1999-03-27 11:30:09 -0800")
my_checking_acct.withdraw(100000)
my_checking_acct.balance.must_equal 10000

You're only checking the return value of withdraw.

end

# Method that handles withdraw
def withdraw(withdraw_amount)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you be able to use super in this method to avoid replicating existing functionality.

end

# Method that handles withdraw_using_check
def withdraw_using_check(withdraw_amount)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use withdraw in this method to save code.

end

# Resets the number of checks used to zero
def reset_checks()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new month functionality wasn't in the requirements and it's making your reset_checks method more cumbersome than it needs to be.

@CheezItMan
Copy link

Bank Account

What We're Looking For

Feature Feedback
Wave 1
All provided tests pass Check
Using the appropriate attr_ for instance variables with some extras well done.
Wave 2
All stubbed tests are implemented fully and pass check
Created instances (by calling new) in Account.all Check
Used CSV library only in Account.all (not in Account.find) I put a note in the code of your PR about this.
Used Account.all to get account list in Account.find Ditto
Wave 3
All stubbed tests are implemented fully and pass Tests are done, you are missing some checks, like making sure the balance doesn't change on withdrawal. I put notes where I saw it in your PR.
Used inheritance in the initialize for both Checking and Savings Accounts (min balance) Done
Used inheritance for the withdraw in checking and savings accounts In CheckingAccount and SavingsAccount you should be using super a lot more than you did. It would save you repeating the use of some code.
Baseline
Used Git Regularly It seems like you're committing irregularly throughout the day.
Answer comprehension questions ArgumentError: It allows your code to signal that the given argument was an unacceptable value and requires the user of your code to fix their behavior.
Extras
Owner Nice work both with the class & reading in the relationship from a file!
MoneyMarketAccount Great work here!

Summary

Overall well done, there are some methods that are too long and complicated (finding owners for example). You should have taken some advantage of inheritance (super) and you're missing some things in your testing.

Despite this you did a very good job on testing and good work on the extras. Nice work!

@Eythan2091-debug
Copy link

How to withdraw from bank account?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants