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); }
public UIATestObject(ObjectDescriptor descriptor, ITestObject parent) : this(descriptor) { _parent = parent; if (parent != null) { parent.AddChild(this); } }
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); } }