I need to write and test xmlStuff.as
. I would like to test it on its own without launching the entire application (launched with index.mxml).
Project
Folder: src
Package: Default Package
- index.mxml
Package: com
Package: ourCompany
Package: ourProduct
Package: util
XmlStuff.as
Package: ...
If I was using java what I would do is I would create a new package:
com.ourCompany.ourProduct.util.test
And I would put this code in it:
public class xmlStuffTester {
public static void main(String [] args){
XmlStuff xs = new XmlStuff();
// Test methods..
System.out.pr开发者_如何学Gointln(xs.method1());
}
}
(Alternatly I would write a unit test if I knew exactly what the xml output should be. I don't know that yet so I prefer the above approach.)
Question: What is the standard way to do this in Flex builder?
You should create unit test for that. Read more info in official documentation.
精彩评论