''Attributes:'' expects, order, description, timeout, async, ui, user defined

''This is a typical use of Test MetaData''

[Test( description = "This tests addition" )]
public function simpleAdd():void 
{
     var x:int = 5 + 3;
     Assert.assertEquals( 8, x );
}

[Test(order=2, description = "This tests subtraction with order set" )]
public function simpleSubtract():void 
{
     var x:int = 6 - 3;
     Assert.assertEquals( 3, x );
}

[Test(async,  description = "This tests textInput text is set correct and VALUE_COMMIT event happens" )]
public function simpleAdd():void 
{
     textInput.addEventListener( FlexEvent.VALUE_COMMIT, 
               Async.asyncHandler( this, handleEvent, 100, null, handleEventNeverOccurred ), 
               false, 0, true );
     testInput.text= "foo";     
}
  • No labels