Actually added missing tests this time?

This commit is contained in:
Peter Hart 2021-02-06 18:23:15 -05:00
parent de470d6c33
commit aa7176e798
2 changed files with 21 additions and 1 deletions

View File

@ -14,3 +14,23 @@ CounterTest >> testCountIsSetAndRead [
c count: 7. c count: 7.
self assert: c count equals: 7. self assert: c count equals: 7.
] ]
{ #category : #tests }
CounterTest >> testDecrement [
self assert: (Counter new count: 2 ; decrement ; decrement) count equals: 0
]
{ #category : #tests }
CounterTest >> testIncrement [
self assert: (Counter new increment; increment) count equals: 2
]
{ #category : #tests }
CounterTest >> testInitialize [
self assert: (Counter new count) equals: 0
]
{ #category : #tests }
CounterTest >> testPrintOn [
self assert: (Counter new printString) equals: 'a Counter with value: 0'
]

View File

@ -31,7 +31,7 @@ Counter >> count [
Counter >> count: val [ Counter >> count: val [
"sets the counter to a specific value" "sets the counter to a specific value"
count := val. count := val.
^ val ^ self
] ]