package com.afi.autoquote.util
{
    public class TestUtil
    {
        // This method is helpful for matching a template object against the result of a parser.
        // For example you load an xml file into the player, parse it, and then match the resulting object
        // against a generic object that has all the keys and values defined as expected.
        // Use in Flexunit parser testing
        public static function propsMatch(template:Array, testTarget:Object):Boolean {
            var obj:Object;
            var key:String;
            var value:*;
            for each(obj in template) {
                key     = obj.key;
                value   = obj.value;
                if(testTarget[key] != value) {
                    return false;
                }
            }
            return true;
        }
    }
}