Thursday, March 25, 2010

Event testing helper for FlexUnit 4

I noticed a little while ago that assertions made in event handlers don’t work the way you’d expect in FlexUnit.  It looks like the event dispatcher wraps its calls to event handlers with a try/catch block and treats any errors it receives as unhandled (showing the exception dialog if you have the debug player installed, ignoring it otherwise).  This means if you have an assertion fail in an event handler it will not cause the test to fail.