blob: f62b2af07b7d92032c39a87fdfbe5d8d47745da9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
Class {
#name : #DieTest,
#superclass : #TestCase,
#category : #Dice
}
{ #category : #tests }
DieTest >> testCreationIsOk [
| d |
d := Die withFaces: 20.
self assert: d faces equals: 20
]
{ #category : #tests }
DieTest >> testInitializationIsOk [
| d |
d := Die new.
self assert: d faces equals: 6
]
{ #category : #tests }
DieTest >> testRolling [
| d |
d := Die new.
10 timesRepeat:
[ self assert: (d roll between: 1 and: 6) ]
]
|