author | Claus Gittinger <cg@exept.de> |
Thu, 28 Mar 2019 13:44:12 +0100 | |
changeset 742 | fbe26a85e34a |
parent 222 | 8e6f482297fa |
child 611 | 1eecc860f4a5 |
child 664 | e31b2e7b658d |
permissions | -rw-r--r-- |
0 | 1 |
"{ Package: 'stx:goodies/sunit' }" |
2 |
||
3 |
TestCase subclass:#ExampleSetTest |
|
4 |
instanceVariableNames:'full empty' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
7 |
category:'SUnit-Tests' |
0 | 8 |
! |
9 |
||
9 | 10 |
|
68 | 11 |
!ExampleSetTest methodsFor:'running'! |
0 | 12 |
|
13 |
setUp |
|
14 |
empty := Set new. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
15 |
full := Set with: 5 with: #abc |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
16 |
! ! |
0 | 17 |
|
68 | 18 |
!ExampleSetTest methodsFor:'testing'! |
0 | 19 |
|
20 |
testAdd |
|
21 |
empty add: 5. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
22 |
self assert: (empty includes: 5) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
23 |
! |
0 | 24 |
|
25 |
testGrow |
|
26 |
empty addAll: (1 to: 100). |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
27 |
self assert: empty size = 100 |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
28 |
! |
0 | 29 |
|
30 |
testIllegal |
|
222 | 31 |
self |
32 |
should: [empty at: 5] |
|
0 | 33 |
raise: TestResult error. |
222 | 34 |
self |
35 |
should: [empty at: 5 put: #abc] |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
36 |
raise: TestResult error |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
37 |
! |
0 | 38 |
|
39 |
testIncludes |
|
40 |
self assert: (full includes: 5). |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
41 |
self assert: (full includes: #abc) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
42 |
! |
0 | 43 |
|
44 |
testOccurrences |
|
45 |
self assert: (empty occurrencesOf: 0) = 0. |
|
46 |
self assert: (full occurrencesOf: 5) = 1. |
|
47 |
full add: 5. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
48 |
self assert: (full occurrencesOf: 5) = 1 |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
49 |
! |
0 | 50 |
|
51 |
testRemove |
|
52 |
full remove: 5. |
|
53 |
self assert: (full includes: #abc). |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
54 |
self deny: (full includes: 5) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
55 |
! ! |
0 | 56 |
|
14 | 57 |
!ExampleSetTest class methodsFor:'documentation'! |
58 |
||
222 | 59 |
version_SVN |
60 |
^ '§Id: ExampleSetTest.st 214 2011-03-14 12:22:21Z vranyj1 §' |
|
14 | 61 |
! ! |