author | Claus Gittinger <cg@exept.de> |
Sat, 08 Dec 2001 02:56:14 +0100 | |
changeset 41 | 9828e423824b |
parent 14 | a4a5478621e3 |
child 68 | 9fd111438d60 |
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 |
!ExampleSetTest class methodsFor:'documentation'! |
11 |
||
12 |
description |
|
13 |
^ 'An example test |
|
41 | 14 |
Tests some operations on Sets. |
15 |
None should fail.' |
|
9 | 16 |
! ! |
17 |
||
0 | 18 |
!ExampleSetTest methodsFor:'Running'! |
19 |
||
20 |
setUp |
|
21 |
empty := Set new. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
22 |
full := Set with: 5 with: #abc |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
23 |
! ! |
0 | 24 |
|
25 |
!ExampleSetTest methodsFor:'Testing'! |
|
26 |
||
27 |
testAdd |
|
28 |
empty add: 5. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
29 |
self assert: (empty includes: 5) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
30 |
! |
0 | 31 |
|
32 |
testGrow |
|
33 |
empty addAll: (1 to: 100). |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
34 |
self assert: empty size = 100 |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
35 |
! |
0 | 36 |
|
37 |
testIllegal |
|
38 |
self |
|
39 |
should: [empty at: 5] |
|
40 |
raise: TestResult error. |
|
41 |
self |
|
42 |
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
|
43 |
raise: TestResult error |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
44 |
! |
0 | 45 |
|
46 |
testIncludes |
|
47 |
self assert: (full includes: 5). |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
48 |
self assert: (full includes: #abc) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
49 |
! |
0 | 50 |
|
51 |
testOccurrences |
|
52 |
self assert: (empty occurrencesOf: 0) = 0. |
|
53 |
self assert: (full occurrencesOf: 5) = 1. |
|
54 |
full add: 5. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
55 |
self assert: (full occurrencesOf: 5) = 1 |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
56 |
! |
0 | 57 |
|
58 |
testRemove |
|
59 |
full remove: 5. |
|
60 |
self assert: (full includes: #abc). |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
61 |
self deny: (full includes: 5) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
62 |
! ! |
0 | 63 |
|
14 | 64 |
!ExampleSetTest class methodsFor:'documentation'! |
65 |
||
66 |
version |
|
41 | 67 |
^ '$Header: /cvs/stx/stx/goodies/sunit/ExampleSetTest.st,v 1.5 2001-12-08 01:55:54 cg Exp $' |
14 | 68 |
! ! |