Пример #1
0
        public override ITestObject AddChild(ITestObject childObject)
        {
            if (childObject == null)
            {
                return(null);
            }

            TestObjectNurse childNurse = childObject as TestObjectNurse;

            if (childNurse == null)
            {
                //childObject is not nurse object
                childNurse = new TestObjectNurse(childObject);
            }

            ITestObject childTestObject = childNurse.TestObject;

            //connect 2 test objects
            if (childTestObject.Parent != _testObject && !this.IsRoot)
            {
                _testObject.AddChild(childTestObject);
            }

            //connect 2 nurses object
            base.AddChild(childNurse);

            if (Nodes != null)
            {
                Nodes.Add(childNurse.TreeNode);
            }
            return(childNurse);
        }
Пример #2
0
        public UIATestObject(ObjectDescriptor descriptor, ITestObject parent) : this(descriptor)
        {
            _parent = parent;

            if (parent != null)
            {
                parent.AddChild(this);
            }
        }
Пример #3
0
        public static void MergeVirtualControls(ITestObject testObject, VirtualTestObject[] virtualObjects)
        {
            //Remove existing virtual objects
            foreach (ITestObject childObject in testObject.Children)
            {
                if (childObject is VirtualTestObject)
                {
                    testObject.RemoveChild(childObject);
                }
            }

            //Add new virtualObjects
            foreach (VirtualTestObject virtualObject in virtualObjects)
            {
                testObject.AddChild(virtualObject);
            }
        }