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

Make dollar amount private #4

Merged
merged 2 commits into from
Sep 28, 2022
Merged

Conversation

kaiosilveira
Copy link
Owner

Back to good OO design principles, we need to make amount private so the Dollar class is encapsulated. We accomplished that by simply updating the tests to use the recently added .equal method from the Dollar class.

Our current tasklist is:

  • $5 + 10CHF = $10 if rate is 2:1 🎯
  • $5 * 2 = $10 ✅
  • Make "amount" private ✅
  • Dollar side-effects? ✅
  • Money rounding?
  • equals() ✅
  • Equal null
  • Equal object

… new Dollar objects instead

Tasklist:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 * 2 = $10 ✅
- Make "amount" private 👈🏼
- Dollar side-effects? ✅
- Money rounding?
- equals() ✅
- Equal null
- Equal object
Tasklist:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 * 2 = $10 ✅
- Make "amount" private ✅
- Dollar side-effects? ✅
- Money rounding?
- equals() ✅
- Equal null
- Equal object
@kaiosilveira kaiosilveira merged commit de59dc4 into main Sep 28, 2022
@kaiosilveira kaiosilveira deleted the chapter4/make-dollar-amount-private branch September 28, 2022 20:18
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.

None yet

1 participant