Example #1
0
        public void VirtualControlEdit_xxx()
        {
            VirtualControlEditWindow editWindow = new VirtualControlEditWindow();

            editWindow.AddControl(new VirtualTestObject("Terminated", new Rectangle(17, 358, 191, 75)));
            editWindow.AddControl(new VirtualTestObject("OnLeave", new Rectangle(13, 443, 196, 80)));
        }
Example #2
0
        public static bool EditVirtualControls(UIATestObject testObject, Image image, ref VirtualTestObject[] virtualControls)
        {
            //TreeNode node = (TreeNode)_selectedNode;

            VirtualControlEditWindow editWindow = new VirtualControlEditWindow();

            //Get image and the virtual controls list of the test object
            editWindow.SetImage(image);
            editWindow.ParentObject = testObject;

            //get the current test object
            editWindow.VirtualControls = virtualControls;

            //Launch the edit window with the parameters
            DialogResult result = editWindow.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.Cancel)
            {
                return(false);
            }

            //get the virtual controls from the edit window
            VirtualTestObject[] controls = editWindow.VirtualControls;

            //TODO merge the controls to the tree
            Debug.WriteLine(DumpVirtualControls(controls));

            virtualControls = controls;
            return(true);
        }
Example #3
0
        public void VirtualControlEdit_AddRemove()
        {
            VirtualControlEditWindow editWindow = new VirtualControlEditWindow();

            editWindow.VirtualControls = _virtualControls;

            Assert.AreEqual(4, editWindow.VirtualControls.Length);

            editWindow.AddControl(new VirtualTestObject("Terminated", new Rectangle(17, 358, 191, 75)));
            editWindow.AddControl(new VirtualTestObject("OnLeave", new Rectangle(13, 443, 196, 80)));

            Assert.AreEqual(6, editWindow.VirtualControls.Length);
        }