ExampleTestResource.st
changeset 46 eb19d69beb10
child 68 9fd111438d60
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ExampleTestResource.st	Thu Dec 13 22:47:44 2001 +0100
@@ -0,0 +1,75 @@
+"{ Package: 'stx:goodies/sunit' }"
+
+TestResource subclass:#ExampleTestResource
+	instanceVariableNames:'runningState'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SUnit-Tests'
+!
+
+
+!ExampleTestResource class methodsFor:'Testing'!
+
+isAvailable
+
+	^super isAvailable and: [self current isStarted]
+! !
+
+!ExampleTestResource methodsFor:'Accessing'!
+
+runningState
+
+	^runningState
+!
+
+runningState: aSymbol
+
+	runningState := aSymbol
+! !
+
+!ExampleTestResource methodsFor:'Constants'!
+
+startedStateSymbol
+
+	^#started
+!
+
+stoppedStateSymbol
+
+	^#stopped
+! !
+
+!ExampleTestResource methodsFor:'Running'!
+
+setUp
+	
+	self runningState: self startedStateSymbol
+!
+
+tearDown
+
+	self runningState: self stoppedStateSymbol
+! !
+
+!ExampleTestResource methodsFor:'Testing'!
+
+isAvailable
+	
+	^self runningState == self startedStateSymbol
+!
+
+isStarted
+	
+	^self runningState == self startedStateSymbol
+!
+
+isStopped
+	
+	^self runningState == self stoppedStateSymbol
+! !
+
+!ExampleTestResource class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/goodies/sunit/ExampleTestResource.st,v 1.1 2001-12-13 21:47:44 cg Exp $'
+! !