Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Lecture 05
  • Loading branch information
sumim committed Dec 9, 2017
1 parent 7693ba3 commit 1a2ac9b
Show file tree
Hide file tree
Showing 28 changed files with 27 additions and 68 deletions.
Empty file.
3 changes: 0 additions & 3 deletions TDD-Money.package/Dollar.class/instance/^equals.st

This file was deleted.

3 changes: 0 additions & 3 deletions TDD-Money.package/Dollar.class/instance/^star.st

This file was deleted.

3 changes: 0 additions & 3 deletions TDD-Money.package/Dollar.class/instance/currency.st

This file was deleted.

5 changes: 0 additions & 5 deletions TDD-Money.package/Dollar.class/instance/printOn..st

This file was deleted.

11 changes: 0 additions & 11 deletions TDD-Money.package/Dollar.class/properties.json

This file was deleted.

Empty file.
3 changes: 0 additions & 3 deletions TDD-Money.package/Franc.class/instance/^equals.st

This file was deleted.

3 changes: 0 additions & 3 deletions TDD-Money.package/Franc.class/instance/^star.st

This file was deleted.

3 changes: 0 additions & 3 deletions TDD-Money.package/Franc.class/instance/currency.st

This file was deleted.

3 changes: 0 additions & 3 deletions TDD-Money.package/Franc.class/instance/hash.st

This file was deleted.

5 changes: 0 additions & 5 deletions TDD-Money.package/Franc.class/instance/printOn..st

This file was deleted.

11 changes: 0 additions & 11 deletions TDD-Money.package/Franc.class/properties.json

This file was deleted.

3 changes: 3 additions & 0 deletions TDD-Money.package/Money.class/class/amount.currency..st
@@ -0,0 +1,3 @@
instance creation
amount: aNumber currency: aSymbol
^ self new setAmount: aNumber currency: aSymbol; yourself
3 changes: 3 additions & 0 deletions TDD-Money.package/Money.class/instance/^equals.st
@@ -0,0 +1,3 @@
comparing
= other
^ other currency == currency and: [ other amount = amount ]
3 changes: 3 additions & 0 deletions TDD-Money.package/Money.class/instance/^star.st
@@ -0,0 +1,3 @@
arithmetic
* multiplier
^ (amount * multiplier) perform: currency
3 changes: 0 additions & 3 deletions TDD-Money.package/Money.class/instance/amount..st

This file was deleted.

4 changes: 1 addition & 3 deletions TDD-Money.package/Money.class/instance/currency.st
@@ -1,5 +1,3 @@
accessing
currency
self subclassResponsibility

"5 USD currency"
^ currency
3 changes: 3 additions & 0 deletions TDD-Money.package/Money.class/instance/printOn..st
@@ -0,0 +1,3 @@
printing
printOn: aStream
aStream print: amount; space; nextPutAll: currency
4 changes: 4 additions & 0 deletions TDD-Money.package/Money.class/instance/setAmount.currency..st
@@ -0,0 +1,4 @@
private
setAmount: aNumber currency: aSymbol
amount := aNumber.
currency := aSymbol
3 changes: 2 additions & 1 deletion TDD-Money.package/Money.class/properties.json
Expand Up @@ -6,7 +6,8 @@
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"amount"
"amount",
"currency"
],
"name" : "Money",
"type" : "normal"
Expand Down

This file was deleted.

@@ -0,0 +1,3 @@
tests
testFiveCHFReturnsAMoney
self assert: 5 CHF class equals: Money

This file was deleted.

@@ -0,0 +1,3 @@
tests
testFiveUSDReturnsAMoney
self assert: 5 USD class equals: Money
2 changes: 1 addition & 1 deletion TDD-Money.package/Number.extension/instance/CHF.st
@@ -1,3 +1,3 @@
*TDD-Money
CHF
^ Franc new amount: self; yourself
^ Money amount: self currency: #CHF
2 changes: 1 addition & 1 deletion TDD-Money.package/Number.extension/instance/USD.st
@@ -1,3 +1,3 @@
*TDD-Money
USD
^ Dollar new amount: self; yourself
^ Money amount: self currency: #USD

0 comments on commit 1a2ac9b

Please sign in to comment.