I have a bunch of NumericSteppers (start week, start year, end week, end year), which are deep within ViewStacks, NavigatorContents etc. I wanted to unit test my date steppers, and was wondering how I can go about doing that? When I initialize the top level parent component, the children components don't get created. Do I have to manually add all these components by iterating down the tree (please say no :) )? Can I do it using UIImpersonator?
Sorry if the question is basic, Flex is very new to me.
In Flash, creating unit tests for GUI components is problematic. I generally write unit tests for controllers, presentation models, mediators (etc) -- ie: the non GUI classes that contain business logic.
Writing tests for GUI objects becomes a losing proposition, for many reasons:
I generally avoid writing unit tests for components like a date stepper, which we compose together to form the greater "view". I typically use a presentation model, and if the component has particular business logic that should be tested, the tests are written for the non-gui presentation model class (or controller, or mediator, or whatever).