コード例 #1
0
 public void UpDownEditAccessibleObject_ctor_default()
 {
     using UpDownBase upDown = new SubUpDownBase();
     using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
     UpDownBase.UpDownEdit.UpDownEditAccessibleObject accessibleObject = new UpDownBase.UpDownEdit.UpDownEditAccessibleObject(upDownEdit, upDown);
     Assert.Equal(upDownEdit, accessibleObject.Owner);
     Assert.False(upDown.IsHandleCreated);
     Assert.False(upDownEdit.IsHandleCreated);
 }
コード例 #2
0
        public void UpDownEditAccessibleObject_KeyboardShortcut_ReturnsParentsKeyboardShortcut()
        {
            using UpDownBase upDown = new SubUpDownBase();
            using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
            AccessibleObject accessibleObject = upDownEdit.AccessibilityObject;

            Assert.Equal(upDown.AccessibilityObject.KeyboardShortcut, accessibleObject.KeyboardShortcut);
            Assert.False(upDown.IsHandleCreated);
            Assert.False(upDownEdit.IsHandleCreated);
        }
コード例 #3
0
        public void UpDownEditAccessibleObject_Default_Name_ReturnsNull()
        {
            using UpDownBase upDown = new SubUpDownBase();
            using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
            AccessibleObject accessibleObject = upDownEdit.AccessibilityObject;

            Assert.Null(accessibleObject.Name);
            Assert.False(upDown.IsHandleCreated);
            Assert.False(upDownEdit.IsHandleCreated);
        }
コード例 #4
0
        public void UpDownEditAccessibleObject_IsIAccessibleExSupported_ReturnsTrue()
        {
            using UpDownBase upDown = new SubUpDownBase();
            using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
            AccessibleObject accessibleObject = upDownEdit.AccessibilityObject;

            Assert.True(accessibleObject.IsIAccessibleExSupported());
            Assert.False(upDown.IsHandleCreated);
            Assert.False(upDownEdit.IsHandleCreated);
        }
コード例 #5
0
        public void UpDownEditAccessibleObject_IsPatternSupported_PatternsSuported(int patternId)
        {
            using UpDownBase upDown = new SubUpDownBase();
            using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
            AccessibleObject accessibleObject = upDownEdit.AccessibilityObject;

            Assert.True(accessibleObject.IsPatternSupported((UiaCore.UIA)patternId));
            Assert.False(upDown.IsHandleCreated);
            Assert.False(upDownEdit.IsHandleCreated);
        }
コード例 #6
0
        public void UpDownEditAccessibleObject_GetPropertyValue_PatternsSuported(int propertyID)
        {
            using UpDownBase upDown = new SubUpDownBase();
            using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
            AccessibleObject accessibleObject = upDownEdit.AccessibilityObject;

            Assert.True((bool)accessibleObject.GetPropertyValue((UiaCore.UIA)propertyID));
            Assert.False(upDown.IsHandleCreated);
            Assert.False(upDownEdit.IsHandleCreated);
        }
コード例 #7
0
        public void UpDownEditAccessibleObject_Default_Name_ReturnsExpected_DomainUpDown()
        {
            using DomainUpDown upDown = new();
            using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
            AccessibleObject accessibleObject = upDownEdit.AccessibilityObject;

            Assert.Equal(SR.EditDefaultAccessibleName, accessibleObject.Name);
            Assert.False(upDown.IsHandleCreated);
            Assert.False(upDownEdit.IsHandleCreated);
        }
コード例 #8
0
        public void UpDownEditAccessibleObject_IsReadOnly_IsExpected(bool readOnly)
        {
            using UpDownBase upDown = new SubUpDownBase();
            using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
            upDownEdit.ReadOnly = readOnly;
            AccessibleObject accessibleObject = upDownEdit.AccessibilityObject;

            Assert.Equal(readOnly, accessibleObject.IsReadOnly);
            Assert.False(upDown.IsHandleCreated);
            Assert.False(upDownEdit.IsHandleCreated);
        }
コード例 #9
0
        public void UpDownEditAccessibleObject_Custom_Name_ReturnsCorrectValue()
        {
            using UpDownBase upDown = new SubUpDownBase();
            string name = "Custom name";

            upDown.AccessibleName = name;
            using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
            AccessibleObject accessibleObject = upDownEdit.AccessibilityObject;

            Assert.Equal(name, accessibleObject.Name);
            Assert.False(upDown.IsHandleCreated);
            Assert.False(upDownEdit.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 UpDownEditAccessibleObject_ControlType_IsExpected_IfAccessibleRoleIsDefault(bool createControl, AccessibleRole expectedRole, int expectedType)
        {
            using UpDownBase upDown = new SubUpDownBase();
            using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
            // AccessibleRole is not set = Default

            if (createControl)
            {
                upDownEdit.CreateControl();
            }

            AccessibleObject accessibleObject = upDownEdit.AccessibilityObject;
            object           actual           = accessibleObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId);

            Assert.Equal(expectedRole, accessibleObject.Role);
            Assert.Equal((UiaCore.UIA)expectedType, actual);
            Assert.Equal(createControl, upDownEdit.IsHandleCreated);
        }
コード例 #12
0
 public void UpDownEditAccessibleObject_ctor_ThrowsException_IfParentIsNull()
 {
     using UpDownBase upDown = new SubUpDownBase();
     using UpDownBase.UpDownEdit upDownEdit = new UpDownBase.UpDownEdit(upDown);
     Assert.Throws <ArgumentNullException>(() => new UpDownBase.UpDownEdit.UpDownEditAccessibleObject(upDownEdit, null));
 }