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

Remove duplication between Dollar and Franc #6

Merged
merged 9 commits into from
Sep 28, 2022

Commits on Sep 28, 2022

  1. introduce Money class

    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
    - 5 CHF * 2 = 10 CHF ✅
    - Dollar/Franc duplication
    - Common `.equals` 👈🏼
    - Common `.times`
    kaiosilveira committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    1a36772 View commit details
    Browse the repository at this point in the history
  2. make Dollar extends Money

    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
    - 5 CHF * 2 = 10 CHF ✅
    - Dollar/Franc duplication
    - Common `.equals` 👈🏼
    - Common `.times`
    kaiosilveira committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    9bdb3a2 View commit details
    Browse the repository at this point in the history
  3. move amount to Money class

    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
    - 5 CHF * 2 = 10 CHF ✅
    - Dollar/Franc duplication
    - Common `.equals` 👈🏼
    - Common `.times`
    kaiosilveira committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    8a9d0ab View commit details
    Browse the repository at this point in the history
  4. expose amount through a getter

    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
    - 5 CHF * 2 = 10 CHF ✅
    - Dollar/Franc duplication
    - Common `.equals` 👈🏼
    - Common `.times`
    kaiosilveira committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    24fe5ac View commit details
    Browse the repository at this point in the history
  5. change Dollar to convert the other item in the comparison to a Money

    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
    - 5 CHF * 2 = 10 CHF ✅
    - Dollar/Franc duplication
    - Common `.equals` 👈🏼
    - Common `.times`
    kaiosilveira committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    0f0e59c View commit details
    Browse the repository at this point in the history
  6. pull up equals from Dollar to Money

    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
    - 5 CHF * 2 = 10 CHF ✅
    - Dollar/Franc duplication
    - Common `.equals` 👈🏼
    - Common `.times`
    kaiosilveira committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    b69f0bb View commit details
    Browse the repository at this point in the history
  7. add equality test for Dollar in Franc tests

    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
    - 5 CHF * 2 = 10 CHF ✅
    - Dollar/Franc duplication
    - Common `.equals` 👈🏼
    - Common `.times`
    kaiosilveira committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    877f22d View commit details
    Browse the repository at this point in the history
  8. compare Franc.amount to Money.amount at Franc.equals

    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
    - 5 CHF * 2 = 10 CHF ✅
    - Dollar/Franc duplication
    - Common `.equals` 👈🏼
    - Common `.times`
    kaiosilveira committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    e97643e View commit details
    Browse the repository at this point in the history
  9. make Franc a subclass of Money

    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
    - 5 CHF * 2 = 10 CHF ✅
    - Dollar/Franc duplication
    - Common `.equals` ✅
    - Common `.times`
    - Compare Francs with Dollars
    kaiosilveira committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    6a263ca View commit details
    Browse the repository at this point in the history