Created
December 11, 2012 02:31
-
-
Save patmaddox/4255397 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object < #STestCase. | |
| + newWithName: aString | |
| ^ self new name: aString; yourself. | |
| - name: aString | |
| name := aString. | |
| - setUp | |
| - tearDown | |
| - run | |
| self setUp. | |
| self perform: name. | |
| self tearDown. | |
| STestCase < #WasRun | |
| instanceVariableNames: 'name log'. | |
| - initialize | |
| super initialize. | |
| log := OrderedCollection new. | |
| - setUp | |
| log add: #setUp. | |
| - tearDown | |
| log add: #tearDown. | |
| - testMethod | |
| log add: #testMethod. | |
| - log | |
| ^ log. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object < #STestCase | |
| instanceVariableNames: 'name'. | |
| + newWithName: aString | |
| ^ self new name: aString; yourself. | |
| - name: aString | |
| name := aString. | |
| - setUp | |
| - tearDown | |
| - run | |
| self setUp. | |
| self perform: name. | |
| self tearDown. | |
| STestCase < #WasRun | |
| instanceVariableNames: 'log'. | |
| - initialize | |
| super initialize. | |
| log := OrderedCollection new. | |
| - setUp | |
| log add: #setUp. | |
| - tearDown | |
| log add: #tearDown. | |
| - testMethod | |
| log add: #testMethod. | |
| - log | |
| ^ log. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TestCase < #SUnitTest. | |
| - test | |
| self testRun. | |
| - testRun | |
| | test | | |
| test := WasRun newWithName: 'testMethod'. | |
| Transcript show: '!!!!!!!!!!'; show: test log; cr. | |
| self assert: test log size equals: 0 withMessage: 'test log should be empty'. | |
| test run. | |
| self assert: test log size equals: 3 withMessage: 'test log should have 3 elements'. | |
| self assert: (test log at: 1) equals: #setUp withMessage: 'test log at: 1 should equal #setUp'. | |
| self assert: (test log at: 2) equals: #testMethod withMessage: 'test log at: 2 should equal #testMethod'. | |
| self assert: (test log at: 3) equals: #tearDown withMessage: 'test log at: 3 should equal #tearDown'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment