Skip to content

Commit

Permalink
Ch.6 done
Browse files Browse the repository at this point in the history
  • Loading branch information
yujihamaguchi committed Dec 9, 2019
1 parent 8aec8d5 commit 89c0a26
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/Example-TDD-Tests/MoneyTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Class {
{ #category : #tests }
MoneyTest >> testEquality [
self assert: (Dollar new amount: 5) equals: (Dollar new amount: 5).
self deny: (Dollar new amount: 5) equals: (Dollar new amount: 6)
self deny: (Dollar new amount: 5) equals: (Dollar new amount: 6).
self assert: (Franc new amount: 5) equals: (Franc new amount: 5).
self deny: (Franc new amount: 5) equals: (Franc new amount: 6)
]

{ #category : #tests }
Expand Down
7 changes: 1 addition & 6 deletions src/Example-TDD/Dollar.class.st
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
Class {
#name : #Dollar,
#superclass : #Object,
#superclass : #Money,
#instVars : [
'amount'
],
#category : #'Example-TDD'
}

{ #category : #comparing }
Dollar >> = anObject [
^ self class = anObject class & (amount = anObject amount)
]

{ #category : #'private-accessing' }
Dollar >> amount [
^ amount
Expand Down
10 changes: 1 addition & 9 deletions src/Example-TDD/Franc.class.st
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
Class {
#name : #Franc,
#superclass : #Object,
#instVars : [
'amount'
],
#superclass : #Money,
#category : #'Example-TDD'
}

{ #category : #comparing }
Franc >> = anObject [
^ self class = anObject class & (amount = anObject amount)
]

{ #category : #'private-accessing' }
Franc >> amount [
^ amount
Expand Down
13 changes: 13 additions & 0 deletions src/Example-TDD/Money.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Class {
#name : #Money,
#superclass : #Object,
#instVars : [
'amount'
],
#category : #'Example-TDD'
}

{ #category : #comparing }
Money >> = anObject [
^ self class = anObject class & (amount = anObject amount)
]

0 comments on commit 89c0a26

Please sign in to comment.