I'm working on a customization game in actionscript. There are several modules of the application. The application is data intensive. In order to boot the application you need to load a lot of other swf's , JSONs etc. I do not want to test the UI bits (for now) . What I want to test is :
- No module crashes
- I get sane answers
I am not concerned with the UI and visual anomalies.
I want to write separate Test Suites for the modules and separate test classes. To be more organized.
Question:
In order to test even the simplest functions I need the X,Y,Z data to be loaded. X,Y,Z data is common for all modules.
How do I write different test classes and suites and preload the data only once and use that copy of data through out the tests. Most data is not changed through the course of tests.
I usually create one or more test versions of each data object Class I need that is a SubClass of the data object with all the properties filled out.
So in the [Before] method, I might set these up like this:
and in the test cases:
So all test cases that need a MyVO, I can then reuse that TestMyVO. If I need multiples, I might create a factory that can create one of several, and then call the one I particularly need to exercise whatever I'm exercising.