创建TestRunner
TestRunner.mxml
1. <?xml version="1.0" encoding="utf-8"?> 2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" 3. xmlns:flexunit="flexunit.flexui.*" 4. creationComplete="onCreationComplete()"> 5. 6. <mx:Script> 7. <![CDATA[ 8. import flexunit.framework.TestSuite; 9. 10. // Create the test suite and run the tests 11. private function onCreationComplete():void 12. { 13. testRunner.test = createSuite(); 14. testRunner.startTest(); 15. } 16. 17. // Creates the test suite to run 18. private function createSuite():TestSuite { 19. var testSuite:TestSuite = new TestSuite(); 20. 21. testSuite.addTestSuite( BankAccountTest ); 22. 23. return testSuite; 24. } 25. ]]> 26. </mx:Script> 27. 28. <!-- FlexUnit GUI Component --> 29. <flexunit:TestRunnerBase id="testRunner" width="100%" height="100%" /> 30. </mx:Application> |