SUnitTest.st
branchjv
changeset 664 e31b2e7b658d
parent 222 8e6f482297fa
child 724 4dae63fce9f9
equal deleted inserted replaced
663:0a8e21b222c1 664:e31b2e7b658d
     1 "{ Package: 'stx:goodies/sunit' }"
     1 "{ Package: 'stx:goodies/sunit' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
     2 
     4 
     3 TestCase subclass:#SUnitTest
     5 TestCase subclass:#SUnitTest
     4 	instanceVariableNames:'hasRun hasSetup hasRanOnce'
     6 	instanceVariableNames:'hasRun hasSetup hasRanOnce'
     5 	classVariableNames:''
     7 	classVariableNames:''
     6 	poolDictionaries:''
     8 	poolDictionaries:''
    27 ! !
    29 ! !
    28 
    30 
    29 !SUnitTest methodsFor:'private'!
    31 !SUnitTest methodsFor:'private'!
    30 
    32 
    31 assertForTestResult: aResult runCount: aRunCount passed: aPassedCount failed: aFailureCount errors: anErrorCount
    33 assertForTestResult: aResult runCount: aRunCount passed: aPassedCount failed: aFailureCount errors: anErrorCount
    32 
    34     self assertForTestResult: aResult runCount: aRunCount passed: aPassedCount failed: aFailureCount errors: anErrorCount skipped: 0
    33 	self
    35 
    34 		assert: aResult runCount = aRunCount;
    36     "Modified: / 03-09-2016 / 08:54:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    35 		assert: aResult passedCount = aPassedCount;
    37 !
    36 		assert: aResult failureCount = aFailureCount;
    38 
    37 		assert: aResult errorCount = anErrorCount
    39 assertForTestResult: aResult runCount: aRunCount passed: aPassedCount failed: aFailureCount errors: anErrorCount skipped: skippedCount
       
    40 
       
    41         self
       
    42                 assert: aResult runCount = aRunCount;
       
    43                 assert: aResult passedCount = aPassedCount;
       
    44                 assert: aResult failureCount = aFailureCount;
       
    45                 assert: aResult errorCount = anErrorCount;
       
    46                 assert: aResult skippedCount = skippedCount
       
    47 
       
    48     "Created: / 03-09-2016 / 08:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    38 !
    49 !
    39 
    50 
    40 error
    51 error
    41 	3 zork
    52 	3 zork
    42 !
    53 !
    54 noop
    65 noop
    55 !
    66 !
    56 
    67 
    57 setRun
    68 setRun
    58 	hasRun := true
    69 	hasRun := true
       
    70 !
       
    71 
       
    72 skipped
       
    73         self skipIf: true description: 'Skipped'
       
    74 
       
    75     "Created: / 03-09-2016 / 08:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    59 ! !
    76 ! !
    60 
    77 
    61 !SUnitTest methodsFor:'running'!
    78 !SUnitTest methodsFor:'running'!
    62 
    79 
    63 setUp
    80 setUp
   197 	self
   214 	self
   198 		should: [true];
   215 		should: [true];
   199 		shouldnt: [false]
   216 		shouldnt: [false]
   200 !
   217 !
   201 
   218 
       
   219 testSkip
       
   220 
       
   221         | case result |
       
   222 
       
   223         case := self class selector: #skipped.
       
   224         result := case run.
       
   225 
       
   226         self
       
   227                 assertForTestResult: result
       
   228                 runCount: 1
       
   229                 passed: 0
       
   230                 failed: 0
       
   231                 errors: 0
       
   232                 skipped: 1
       
   233 
       
   234     "Created: / 03-09-2016 / 08:53:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   235 !
       
   236 
   202 testSuite
   237 testSuite
   203 
   238 
   204 	| suite result |
   239 	| suite result |
   205 
   240 
   206 	suite := TestSuite new.
   241 	suite := TestSuite new.
   223 
   258 
   224 version
   259 version
   225     ^ '$Header: /cvs/stx/stx/goodies/sunit/SUnitTest.st,v 1.11 2011-06-29 19:15:49 cg Exp $'
   260     ^ '$Header: /cvs/stx/stx/goodies/sunit/SUnitTest.st,v 1.11 2011-06-29 19:15:49 cg Exp $'
   226 !
   261 !
   227 
   262 
       
   263 version_HG
       
   264 
       
   265     ^ '$Changeset: <not expanded> $'
       
   266 !
       
   267 
   228 version_SVN
   268 version_SVN
   229     ^ '§Id: SUnitTest.st 214 2011-03-14 12:22:21Z vranyj1 §'
   269     ^ '§Id: SUnitTest.st 214 2011-03-14 12:22:21Z vranyj1 §'
   230 ! !
   270 ! !
       
   271