Browse files

adjusted test helpers

  • Loading branch information...
1 parent e695f5f commit 3c06ba214a96d83c049fd65a57a8552ca0642df5 @saschaernst saschaernst committed Jan 30, 2012
View
15 src/net/wooga/robotlegs/tests/AbstractModelTest.as
@@ -0,0 +1,15 @@
+package net.wooga.robotlegs.tests {
+ public class AbstractModelTest extends AbstractRobotlegsTest {
+ protected var _model:Object;
+
+ override public function init():void {
+ _model = initModel();
+
+ super.init();
+ }
+
+ protected function initModel():Object {
+ return null;
+ }
+ }
+}
View
14 ...ooga/robotlegs/tests/AbstractActorTest.as → ...ga/robotlegs/tests/AbstractServiceTest.as
@@ -7,7 +7,7 @@ package net.wooga.robotlegs.tests {
import org.robotlegs.utilities.modular.core.IModuleEventDispatcher;
import org.robotlegs.utilities.modular.mvcs.ModuleActor;
- public class AbstractActorTest extends AbstractRobotlegsTest {
+ public class AbstractServiceTest extends AbstractRobotlegsTest {
[Mock]
public function set dispatcher(value:IEventDispatcher):void {
_dispatcher = value;
@@ -18,27 +18,27 @@ package net.wooga.robotlegs.tests {
_moduleDispatcher = value;
}
- protected var _actor:Actor;
+ protected var _service:ModuleActor;
override public function init():void {
- _actor = initActor();
+ _service = initService();
super.init();
}
- protected function initActor():Actor {
+ protected function initService():ModuleActor {
return null;
}
override protected function initDispatcher():void {
- _actor.eventDispatcher = _dispatcher;
+ _service.eventDispatcher = _dispatcher;
given(_dispatcher.hasEventListener(anyOf(String))).willReturn(true);
}
override protected function initModuleDispatcher():void {
- if (_actor is ModuleActor) {
- ModuleActor(_actor).moduleEventDispatcher = _moduleDispatcher;
+ if (_service is ModuleActor) {
+ ModuleActor(_service).moduleEventDispatcher = _moduleDispatcher;
given(_moduleDispatcher.hasEventListener(anyOf(String))).willReturn(true);
}

0 comments on commit 3c06ba2

Please sign in to comment.