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;
        }

    }

}