Created
August 31, 2012 07:17
-
-
Save creynders/3549826 to your computer and use it in GitHub Desktop.
This file contains 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
class BaseService{ | |
public function load():void{ | |
this.onLoadComplete() | |
} | |
public function onLoadComplete():void{ | |
} | |
} |
This file contains 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
class BaseServiceTest{ | |
public var instance : BaseService; | |
[Test] | |
public function test_load_callsOnLoadComplete():void{ | |
instance.load(); | |
//how to test onLoadComplete was called? | |
} | |
} |
This file contains 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
class ConcreteService extends EventDispatcher{ | |
override public function onLoadComplete():void{ | |
dispatchEvent( new ConcreteServiceEvent( ConcreteServiceEvent.LOAD_COMPLETE ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment