Skip to content

Instantly share code, notes, and snippets.

@creynders
Created August 31, 2012 07:17
Show Gist options
  • Save creynders/3549826 to your computer and use it in GitHub Desktop.
Save creynders/3549826 to your computer and use it in GitHub Desktop.
class BaseService{
public function load():void{
this.onLoadComplete()
}
public function onLoadComplete():void{
}
}
class BaseServiceTest{
public var instance : BaseService;
[Test]
public function test_load_callsOnLoadComplete():void{
instance.load();
//how to test onLoadComplete was called?
}
}
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