Ejemplo n.º 1
0
        public void CustomListCollection()
        {
            IResource        resource = new ReadOnlyXmlTestResource("collections.xml", GetType());
            XmlObjectFactory xof      = new XmlObjectFactory(resource);
            TestObject       objectWithTypedFriends = (TestObject)xof.GetObject("objectWithTypedFriends");
            TestObjectList   tol = objectWithTypedFriends.TypedFriends;

            Assert.AreEqual(1, tol.Count);
            Assert.IsTrue(tol[0].Equals(xof.GetObject("david")));
        }
Ejemplo n.º 2
0
        public virtual ITestObject AddChild(ITestObject childObject)
        {
            if (_children == null)
            {
                _children = new TestObjectList();
            }
            _children.Add(childObject);
            childObject.Parent = this;

            return(childObject);
        }
Ejemplo n.º 3
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);
             *  }
             * }*/
        }