[Pharo] Personal fitness tracker web app.
1
"
2
A MFTWorkoutPrescriptionTest is a test class for testing the behavior of MFTWorkoutPrescription
3
"
4
Class {
5
#name : 'MFTWorkoutPrescriptionTest',
6
#superclass : 'TestCase',
7
#category : 'MyFitnessTracker-Core-Tests-Prescription',
8
#package : 'MyFitnessTracker-Core-Tests',
9
#tag : 'Prescription'
10
}
11
12
{ #category : 'tests' }
13
MFTWorkoutPrescriptionTest >> newSetPrescription [
14
"Use a real MFTSetPrescription instance without invoking the currently incomplete class-side constructors."
15
16
^ MFTSetPrescription basicNew
17
]
18
19
{ #category : 'tests' }
20
MFTWorkoutPrescriptionTest >> testCanonicalNameAnswersTitle [
21
22
| workout |
23
workout := MFTWorkoutPrescription new.
24
workout title: 'Chest and Back'.
25
26
self assert: workout canonicalName equals: 'Chest and Back'
27
]
28
29
{ #category : 'tests' }
30
MFTWorkoutPrescriptionTest >> testInitializeCreatesEmptySetGroups [
31
32
| workout |
33
workout := MFTWorkoutPrescription new.
34
35
self assert: workout setGroups isEmpty.
36
self assert: workout sets isEmpty
37
]
38
39
{ #category : 'tests' }
40
MFTWorkoutPrescriptionTest >> testSetGroupsCanBeReplaced [
41
42
| workout set group groups |
43
workout := MFTWorkoutPrescription new.
44
set := self newSetPrescription.
45
group := MFTStraightSetGroupPrescription with: set.
46
groups := OrderedCollection with: group.
47
48
workout setGroups: groups.
49
50
self assert: workout setGroups identicalTo: groups.
51
self assert: workout sets asArray equals: { set }
52
]
53
54
{ #category : 'tests' }
55
MFTWorkoutPrescriptionTest >> testTitleAccessor [
56
57
| workout |
58
workout := MFTWorkoutPrescription new.
59
workout title: 'Heavy Duty Day 1'.
60
61
self assert: workout title equals: 'Heavy Duty Day 1'
62
]
63