Exemplo n.º 1
0
 ///<summary>
 /// Check items matching those in the given list.
 ///</summary>
 ///<param name="matchList">The list of items to check.</param>
 public void CheckSelectedItems(ArrayList matchList)
 {
     foreach (object item in CheckedItems)
     {
         FormsAssert.IsTrue(matchList.Contains(item));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Click a pushbutton
        /// </summary>
        public void Click()
        {
            FormsAssert.IsTrue((button.Style == ToolBarButtonStyle.PushButton) ||
                               (button.Style == ToolBarButtonStyle.ToggleButton));
            ToolBarButtonClickEventArgs buttonArg = new ToolBarButtonClickEventArgs(Button);

            bar.FireEvent("ButtonClick", buttonArg);
        }
Exemplo n.º 3
0
        internal void Focus()
        {
            Control c = tester.TheObject as Control;

            FormsAssert.IsTrue(c != null, "Keyboard control requires tester of Control");
            c.FindForm().Activate();
            c.Focus();
        }
Exemplo n.º 4
0
 /// <summary>
 /// Click an item in a dropdown menu
 /// </summary>
 /// <param name="menuText">The name of the menu item to click</param>
 public void ClickDropDownMenuItem(string menuText)
 {
     FormsAssert.IsTrue(button.Style == ToolBarButtonStyle.DropDownButton);
     foreach (MenuItem item in button.DropDownMenu.MenuItems)
     {
         if (item.Text == menuText)
         {
             item.PerformClick();
             return;
         }
     }
 }
        /// <summary>
        /// Clicks the DropDownItem with the given index.
        /// </summary>
        /// <param name="index"></param>
        public void ClickDropDownItem(int index)
        {
            bool found = false;
            ToolStripSplitButton button = Properties;

            if (button.HasDropDownItems)
            {
                ToolStripItemCollection items = button.DropDownItems;
                if (items.Count > index)
                {
                    ToolStripItem item = items[index];
                    FireEvent("DropDownItemClicked", new ToolStripItemClickedEventArgs(item));
                    found = true;
                }
            }
            FormsAssert.IsTrue(found, "No drop down item found at that index.");
        }
Exemplo n.º 6
0
 public void PartialPush()
 {
     FormsAssert.IsTrue(button.Style == ToolBarButtonStyle.ToggleButton);
     PartialPushed = !PartialPushed;
 }