Skip to main content
Participant
October 9, 2010
質問

Test Script for Event driven function

  • October 9, 2010
  • 返信数 1.
  • 444 ビュー

Hi,

i m new to this product. i have one doubt , is it possible to write test scripts for event driven functions ?

if possible, could you please share some samples.?

Thnk you.

Bala.

このトピックへの返信は締め切られました。

返信数 1

Participating Frequently
October 9, 2010

Yes.

At the simplest, you could have a test like this:

[Test]

public function shouldThrowEvent():void {

  var eventCalled:Boolean = false;

  var someEventDispatcher:SomeEventDispatcher = new SomeEventDispatcher();

  someEventDispatcher.addEventListener( "someEvent",

          function ( event:Event ) {

               eventCalled = true;

          }

  assertTrue( eventCalled );

}

I would recommend looking at docs.flexunit.org for more information.

Mike