Last active
December 14, 2015 15:38
-
-
Save MindScriptAct/5108807 to your computer and use it in GitHub Desktop.
AsyncUtil usage for AsUnit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import flexunit.framework.Assert; | |
import utils.AsyncUtil; | |
/** | |
* COMMENT | |
*/ | |
public class BasicTests { | |
private var asincFunction:Function; | |
[Before] | |
public function runBeforeEveryTest():void { | |
} | |
[After] | |
public function runAfterEveryTest():void { | |
} | |
//---------------------------------- | |
// tests | |
//---------------------------------- | |
[Test(async)] | |
public function unit_test_outcome():void { | |
asincFunction = AsyncUtil.asyncHandler(this, callBack, ["I am aditionalParam."], 2000, failFunciton); | |
asincFunction("I am callBackParam!"); | |
} | |
private function callBack(callBackParam:String, aditionalParam:String):void { | |
trace( "BasicTests.callBack > callBackParam : " + callBackParam + ", aditionalParam : " + aditionalParam ); | |
} | |
private function failFunciton(aditionalParam:String):void { | |
trace( "BasicTests.failFunciton > aditionalParam : " + aditionalParam ); | |
Assert.fail("My fail message"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment