Tuesday, 27 April 2010

ErrorTestUtils


package domain.utils
{
public class ErrorTestUtils
{
public function ErrorTestUtils()
{
}


public static function isErrorThrown(callMethodThatCausesError:Function,errorReport:String,args:Array):Boolean
{
var errorThrown:Boolean = false;
try
{
callMethodThatCausesError.apply(null,args);
}
catch(e:Error)
{
errorThrown = (e.message == errorReport)
}

return errorThrown;
}

}
}

Posted via email from fasanya's posterous

No comments: