tags:

views:

68

answers:

2

Flex is a client-side language and based on events. How can such events be mocked to allow unit testing?

A: 

Take a look at FlexUnit and FlexMonkey

If you are writing your components to user Interfaces rather than concrete components, mocking objects is as simple as a new implementation.

Gregor Kiddie
A: 

There are also real mock libraries for AS3. Take a look at this tutorial:

http://www.allenmanning.com/?p=7

and the Mockolate library. I have actually used mock-as3, which is Mockolate's ancestor. With it you can create fake objects that act like dummy facades for things irrelevant to your testing: this way you can focus on testing a specific piece of code (be it in a UI class or not) decoupling it from its dependencies.

ettore