Created
November 28, 2010 23:30
-
-
Save joelhooks/719394 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
[Test] | |
public function command_dispatches_completed_when_all_sync_commands_complete():void | |
{ | |
var command:CompositeSignalCommand = getCompositeSignalCommandWithThreeSubCommands(); | |
var completedSignal:VerifyDispatchSignal = new VerifyDispatchSignal(); | |
command.completed = completedSignal; | |
command.execute(); | |
assertThat(completedSignal.dispatched, isTrue()); | |
} | |
private function getCompositeSignalCommandWithThreeSubCommands():CompositeSignalCommand | |
{ | |
var command:CompositeSignalCommand = new CompositeSignalCommand(); | |
command.reflector = new SwiftSuspendersReflector(); | |
command.injector = context.getInjector(); | |
command.signalCommandMap = new SignalCommandMap(command.injector); | |
command.addCommand(TestCompleteSyncCommand); | |
command.addCommand(TestCompleteSyncCommand); | |
command.addCommand(TestCompleteSyncCommand); | |
return command | |
} |
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
package org.robotlegs.test.support | |
{ | |
import org.osflash.signals.Signal; | |
public class VerifyDispatchSignal extends Signal | |
{ | |
public var dispatched:Boolean; | |
override public function dispatch(... rest):void | |
{ | |
dispatched = true; | |
super.dispatch(rest); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment