开发者

Flash Builder: Change default suite for unit tests?

开发者 https://www.devze.com 2023-01-29 20:56 出处:网络
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

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消