Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8320299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:36:44+00:00 2026-06-08T22:36:44+00:00

I have a bunch of NumericSteppers (start week, start year, end week, end year),

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:36:45+00:00Added an answer on June 8, 2026 at 10:36 pm

    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:

    • the view’s logic tends to need to be triggered by user interaction
    • the view may depend on low level Flash API’s (NetStream, Camera, etc) that are difficult to simulate/mock in tests)
    • running tests that have GUI elements (things that use the stage or that you add to the stage) is not possible when running tests automatically (ie: kicked off by your continuous integration or build system)
    • tests tend to run slower

    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).

    public class MyViewPM
    {
       // write a unit test for this method
       public function onSubmitButtonClick():void
       {
       }
    }
    
    public class MyView extends Sprite
    {
        // this is injected by your MVC framework
        // or set when the the view is created, or added to stage, etc.
        public var pm:MyViewPM;
    
        public function MyView()
        {
            submitButton.addEventListener(MouseEvent.Click, onMouseClick);
        }
    
        private function onMouseClick(event:Event):void
        {
            pm.onSubmitButtonClick();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have bunch of autogenerated classes which are mostly Axis2 stubs, skeletons etc. For
I have bunch of strings, some of which are fairly long, like so: movie.titles
We have bunch of Domain Entities which should be rendered to an html format,
week DKK id=radio2 value=75 /> I have bunch of these div entry generated by
I have bunch of temporal data which I want to convert to RDF format.
I have bunch of methods in which i need to test whether remote server
I have a bunch of files which contain an ascii header with a time
I have bunch of hidden columns in my jqGrid, on which I want to
i have bunch of buttons within linear layout. But there is spaces buttons. I
Have a bunch of classes which I need to do serialize and deserialize from/to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.