Example #1
0
        public void PropertyItemTest()
        {
            ObjectDescriptor descriptor = new ObjectDescriptor();

            descriptor.Name = "Button";

            VisualRelationPropertyItem item = descriptor.GetItem <VisualRelationPropertyItem>();

            Assert.AreEqual(null, item);

            item = new VisualRelationPropertyItem()
            {
                Left = "aaa", Right = "bbb"
            };
            descriptor.SetItem(item);

            string result = JsonUtil.SerializeObject(descriptor);

            Debug.WriteLine(result);
        }
Example #2
0
        public UIATestObject(ObjectDescriptor descriptor)
        {
            _nodeName = descriptor.Name;

            _description = descriptor.Description;

            _relation = descriptor.GetItem <VisualRelationPropertyItem>();

            IdentifyPropertyGroup propertyItem = descriptor.GetItem <IdentifyPropertyGroup>();

            CachedPropertyGroup cachedItem = descriptor.GetItem <CachedPropertyGroup>();

            if (cachedItem != null)
            {
                SetContext <CachedPropertyGroup>(cachedItem);
            }

            _properties = (propertyItem != null) ? propertyItem.Properties : new PropertiesDictionary();

            if (_properties.ContainsKey(UIAControlKeys.Type))
            {
                _type = _properties[UIAControlKeys.Type].ToControlType();
            }
            if (_children == null)
            {
                _children = new TestObjectList();
            }

            /*
             * if (descriptor.Children != null)
             * {
             *  foreach (ObjectDescriptor child in descriptor.Children)
             *  {
             *      new UIATestObject(child, this);
             *  }
             * }*/
        }