Skip to content

Instantly share code, notes, and snippets.

@drewbourne
Created September 26, 2011 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewbourne/1241369 to your computer and use it in GitHub Desktop.
Save drewbourne/1241369 to your computer and use it in GitHub Desktop.
package mockolate.examples
{
public class MockolateFlexUnitAsyncPrepareExample
{
public var command:CreateOrUpdateConstituentCommand;
public var constituent:Constituent;
public var constituentModel:IConstituentModel;
[Before(order=1, async)]
public function prepareMocks():void
{
var mockolatePreparer:IEventDispatcher = prepare(IConstituentModel);
Async.proceedOnEvent(this, mockolatePreparer, Event.COMPLETE);
}
[Before(order=2)]
public function setup():void
{
constituent = new Constituent();
command = new CreateOrUpdateConstituentCommand();
command.eventDispatcher = new EventDispatcher();
command.event = new PetitionEvent(PetitionEvent.PETITION_SUBMITED, false, false, constituent);
command.constituentModel = nice(IConstituentModel);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment