summaryrefslogtreecommitdiff
path: root/pharo-mooc/redo/src/Dice/DieTest.class.st
diff options
context:
space:
mode:
Diffstat (limited to 'pharo-mooc/redo/src/Dice/DieTest.class.st')
-rw-r--r--pharo-mooc/redo/src/Dice/DieTest.class.st30
1 files changed, 30 insertions, 0 deletions
diff --git a/pharo-mooc/redo/src/Dice/DieTest.class.st b/pharo-mooc/redo/src/Dice/DieTest.class.st
new file mode 100644
index 0000000..f62b2af
--- /dev/null
+++ b/pharo-mooc/redo/src/Dice/DieTest.class.st
@@ -0,0 +1,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) ]
+]