public void ToolStripLabelAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using ToolStripLabel toolStripLabel = new ToolStripLabel(); toolStripLabel.AccessibleRole = role; Assert.Equal(AccessibleRoleControlTypeMap.GetControlType(role), toolStripLabel.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId)); Assert.Null(toolStripLabel.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ValueValuePropertyId)); }
public void AccessibleRoleControlTypeMap_Contains_AllRoles(AccessibleRole role) { // Check if the map contains the role // If so the map returns an exist UIA_ControlTypeId UIA actual = AccessibleRoleControlTypeMap.GetControlType(role); Assert.True(actual >= UIA.ButtonControlTypeId && actual <= UIA.AppBarControlTypeId); }
public void AccessibleRoleControlTypeMap_GetControlType_ReturnsExpectedValue(AccessibleRole role, int expectedType) { // UIA is less accessible than the test // so we have to use "int" type for "expectedType" argument UIA actual = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal((UIA)expectedType, actual); }
public void CheckBoxAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using CheckBox checkBox = new CheckBox(); checkBox.AccessibleRole = role; UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, checkBox.AccessibilityObject.GetPropertyValue(UIA.ControlTypePropertyId)); Assert.Equal(checkBox.AccessibilityObject.DefaultAction, checkBox.AccessibilityObject.GetPropertyValue(UIA.LegacyIAccessibleDefaultActionPropertyId)); Assert.False(checkBox.IsHandleCreated); }
public void SplitContainerAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using SplitContainer splitContainer = new(); splitContainer.AccessibleRole = role; object actual = splitContainer.AccessibilityObject.GetPropertyValue(UIA.ControlTypePropertyId); UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(splitContainer.IsHandleCreated); }
public void DomainUpDownAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using DomainUpDown domainUpDown = new DomainUpDown(); domainUpDown.AccessibleRole = role; object actual = domainUpDown.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(domainUpDown.IsHandleCreated); }
public void ListBoxAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using ListBox listBox = new ListBox(); listBox.AccessibleRole = role; object actual = listBox.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(listBox.IsHandleCreated); }
public void ToolStripButtonAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using ToolStripButton toolStripButton = new ToolStripButton(); toolStripButton.AccessibleRole = role; object actual = toolStripButton.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); }
public void PanelAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using Panel panel = new(); panel.AccessibleRole = role; object actual = panel.AccessibilityObject.GetPropertyValue(UIA.ControlTypePropertyId); UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(panel.IsHandleCreated); }
public void TabPageAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using TabPage tabPage = new(); tabPage.AccessibleRole = role; object actual = tabPage.AccessibilityObject.GetPropertyValue(UIA.ControlTypePropertyId); UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(tabPage.IsHandleCreated); }
public void DataGridViewTextBoxEditingControlAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using DataGridViewTextBoxEditingControl textCellControl = new DataGridViewTextBoxEditingControl(); textCellControl.AccessibleRole = role; object actual = textCellControl.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(textCellControl.IsHandleCreated); }
public void MenuStripAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using MenuStrip menuStrip = new MenuStrip(); menuStrip.AccessibleRole = role; object actual = menuStrip.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(menuStrip.IsHandleCreated); }
public void TextBoxBaseAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using TextBoxBase textBoxBase = new SubTextBoxBase(); textBoxBase.AccessibleRole = role; object actual = textBoxBase.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(textBoxBase.IsHandleCreated); }
public void PropertyGridAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using PropertyGrid propertyGrid = new PropertyGrid(); propertyGrid.AccessibleRole = role; object actual = propertyGrid.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(propertyGrid.IsHandleCreated); }
public void FormAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using Form form = new Form(); form.AccessibleRole = role; object actual = form.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(form.IsHandleCreated); }
public void ToolStripItemAccessibleObject_GetPropertyValue_ControlTypeProperty_ReturnsCorrectValue(AccessibleRole role) { using ToolStripItem toolStripItem = new SubToolStripItem(); toolStripItem.AccessibleRole = role; UIA actual = (UIA)toolStripItem.AccessibilityObject.GetPropertyValue(UIA.ControlTypePropertyId); UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); // Check if the method returns an exist UIA_ControlTypeId Assert.True(actual >= UIA.ButtonControlTypeId && actual <= UIA.AppBarControlTypeId); }
public void MonthCalendarAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using MonthCalendar monthCalendar = new MonthCalendar(); monthCalendar.AccessibleRole = role; object actual = monthCalendar.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(monthCalendar.IsHandleCreated); }
public void ButtonAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using Button button = new Button(); button.AccessibleRole = role; object actual = button.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(button.IsHandleCreated); }
public void TableLayoutPanelAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using TableLayoutPanel tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.AccessibleRole = role; object actual = tableLayoutPanel.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(tableLayoutPanel.IsHandleCreated); }
public void DateTimePickerAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using DateTimePicker dateTimePicker = new(); dateTimePicker.AccessibleRole = role; object actual = dateTimePicker.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(dateTimePicker.IsHandleCreated); }
public void UpDownEditAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using UpDownBase upDown = new SubUpDownBase(); using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown); upDownEdit.AccessibleRole = role; object actual = upDownEdit.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(upDownEdit.IsHandleCreated); }
public void ToolStripProgressBarControlAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using ToolStripProgressBarControl toolStripProgressBarControl = new ToolStripProgressBarControl(); toolStripProgressBarControl.AccessibleRole = role; AccessibleObject accessibleObject = toolStripProgressBarControl.AccessibilityObject; object actual = accessibleObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(role, accessibleObject.Role); Assert.Equal(expected, actual); Assert.False(toolStripProgressBarControl.IsHandleCreated); }
public void DataGridViewEditingPanelAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using DataGridView dataGridView = new DataGridView(); Panel editingPanel = dataGridView.EditingPanel; editingPanel.AccessibleRole = role; object actual = editingPanel.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); Assert.False(editingPanel.IsHandleCreated); }
public void ToolStripComboBoxControlAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using ToolStripComboBox toolStripComboBox = new ToolStripComboBox(); toolStripComboBox.AccessibleRole = role; ToolStripComboBoxControl control = (ToolStripComboBoxControl)toolStripComboBox.ComboBox; control.CreateControl(); AccessibleObject accessibleObject = toolStripComboBox.AccessibilityObject; object actual = accessibleObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); Assert.Equal(role, accessibleObject.Role); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(expected, actual); }
public void ToolStripOverflowAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role) { using ToolStripButton toolStripItem = new ToolStripButton(); using ToolStripOverflow toolStripOverflow = new ToolStripOverflow(toolStripItem); toolStripOverflow.AccessibleRole = role; AccessibleObject accessibleObject = toolStripOverflow.AccessibilityObject; object actual = accessibleObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId); UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role); Assert.Equal(role, accessibleObject.Role); Assert.Equal(expected, actual); Assert.False(toolStripOverflow.IsHandleCreated); }
public void AccessibleRoleControlTypeMap_GetControlType_ThrowsException_IfRoleArgumentIsIncorrect() { AccessibleRole incorrectRole = (AccessibleRole)(-999); Assert.Throws <KeyNotFoundException>(() => AccessibleRoleControlTypeMap.GetControlType(incorrectRole)); }