Flash Builder: Change default suite for unit tests?
What are the steps to change your default s开发者_开发技巧uite when running unit tests in Flash Builder 4 with PureMVC?
When you create a new test case or a new test suite you can select whether to use FlexUnit4 or FlexUnit1 from the top of the menu. I looked around and didn't see any way to pre-select one or the other a priori.
In order to change or add to the test suites, I had to change the test suite in the listener for the startup event on the mediator for the application component.
override public function handleNotification( note:INotification ):void
{
switch ( note.getName() )
{
case NotificationConstants.STARTUP_SUCCESS:
flexUnitApplication.testRunner.runWithFlexUnit4Runner(currentRunTestSuite(), "MyTests");
break;
}
}
private function currentRunTestSuite():Array
{
var testsToRun:Array = new Array();
testsToRun.push(MyTestSuite);
return testsToRun;
}
精彩评论