Skip to content

Commit

Permalink
#15 第1章 p.33までの仮実装 依存性と重複
Browse files Browse the repository at this point in the history
  • Loading branch information
catcoswavist committed Jul 27, 2023
1 parent d2c51f3 commit 8aa9579
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions catcoswavist/TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- $ 5 + 10 CHF = $ 10( レート が 2: 1 の 場合)
- $ 5 * 2 = $ 10
- amount を private に する
- Dollar の 副作用 どう する?
- Money の 丸め 処理 どう する?
- [ ] $ 5 + 10 CHF = $ 10( レート が 2: 1 の 場合)
- [x] $ 5 * 2 = $ 10
- [ ] amount を private に する
- [ ] Dollar の 副作用 どう する?
- [ ] Money の 丸め 処理 どう する?
8 changes: 4 additions & 4 deletions catcoswavist/dollar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Dollar:
def __init__(self,amount):
self.amount = 10
def __init__(self,amount:int) -> int:
self.amount = amount

def times(self, multiplier):
pass
def times(self, multiplier:int) -> int:
self.amount = 5 * 2
2 changes: 1 addition & 1 deletion catcoswavist/test_money.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ class TestMoney():
def test_multiplication(self):

five = Dollar(5)
product = five.times(2)
five.times(2)
assert 10 == five.amount

0 comments on commit 8aa9579

Please sign in to comment.