[Pharo] Personal fitness tracker web app.
MFTWeights are now immutable.
src/MyFitnessTracker-Tests/MFTWeightTest.class.st
@@ -10,18 +10,20 @@
10
10
MFTWeightTest >> testWeightIsCreatedCorrectlyBirthday [
11
11
12
12
| weight |
13
Removed:
weight := MFTWeight date: (Date fromString: '06/14/1996').
14
Removed:
weight value: 90.5.
15
Removed:
self assert: weight date equals: (Date fromString: '06/14/1996').
16
Removed:
self assert: weight value equals: 90.5
13
Added:
weight := MFTWeight
14
Added:
kilograms: 90.5
15
Added:
date: (Date readFrom: '14/06/1996' pattern: 'dd/mm/yyyy').
16
Added:
self
17
Added:
assert: weight date
18
Added:
equals: (Date readFrom: '14/06/1996' pattern: 'dd/mm/yyyy').
19
Added:
self assert: weight kilograms equals: 90.5
17
20
]
18
21
19
22
{ #category : 'tests' }
20
23
MFTWeightTest >> testWeightIsCreatedCorrectlyToday [
21
24
22
25
| weight |
23
Removed:
weight := MFTWeight new.
24
Removed:
weight value: 90.0.
26
Added:
weight := MFTWeight kilograms: 90.0 date: Date today.
25
27
self assert: weight date equals: Date today.
26
Removed:
self assert: weight value equals: 90.0
28
Added:
self assert: weight kilograms equals: 90.0
27
29
]