Esempio n. 1
0
        public override dynamic GenerateTrashValue(GoInstance goInstance)
        {
            ExpandoObject mainObjectInstance = new ExpandoObject();

            var mainObjectInstanceDict = mainObjectInstance as IDictionary <string, dynamic>;

            var propertyIterator = _properties.Keys.GetEnumerator();

            while (propertyIterator.MoveNext())
            {
                GoProperty currProp = _properties[propertyIterator.Current];

                dynamic propertyInstance = currProp.GenerateTrashValue(goInstance);

                mainObjectInstanceDict.Add(propertyIterator.Current, propertyInstance);
            }

            return(mainObjectInstanceDict);
        }
Esempio n. 2
0
        public dynamic GetRandomInstanceObject(string objectKey)
        {
            ExpandoObject mainObjectInstance = new ExpandoObject();

            GoObject objectToInstance = _instanceTypes[objectKey];

            var mainObjectInstanceDict = mainObjectInstance as IDictionary <string, dynamic>;


            var propertyIterator = objectToInstance._properties.Keys.GetEnumerator();

            while (propertyIterator.MoveNext())
            {
                GoProperty currProp = objectToInstance._properties[propertyIterator.Current];

                dynamic propertyInstance = currProp.GenerateTrashValue(this);

                mainObjectInstanceDict.Add(propertyIterator.Current, propertyInstance);
            }

            return(mainObjectInstanceDict);
        }