Exemple #1
0
        public void GroupBoxAccessibleObject_LegacyIAccessible_Role_ReturnsExpected()
        {
            using var groupBox      = new GroupBox();
            groupBox.Name           = "Group1";
            groupBox.Text           = "Some test groupBox text";
            groupBox.AccessibleRole = AccessibleRole.Link;
            var groupBoxAccessibleObject = new GroupBox.GroupBoxAccessibleObject(groupBox);

            Assert.False(groupBox.IsHandleCreated);
            Assert.Equal(AccessibleRole.Link, groupBoxAccessibleObject.Role);
        }
Exemple #2
0
        public void GroupBoxAccessibleObject_LegacyIAccessible_Description_ReturnsExpected()
        {
            string testAccDescription = "Test description";

            using var groupBox             = new GroupBox();
            groupBox.Name                  = "Group1";
            groupBox.Text                  = "Some test groupBox text";
            groupBox.AccessibleDescription = testAccDescription;
            var groupBoxAccessibleObject = new GroupBox.GroupBoxAccessibleObject(groupBox);

            Assert.False(groupBox.IsHandleCreated);
            Assert.Equal(testAccDescription, groupBoxAccessibleObject.Description);
        }
Exemple #3
0
        public void GroupBoxAccessibleObject_IsPatternSupported_LegacyIAccessible_ReturnsTrue()
        {
            using var groupBox = new GroupBox();
            groupBox.Name      = "Group1";
            groupBox.Text      = "Some test groupBox text";
            var groupBoxAccessibleObject = new GroupBox.GroupBoxAccessibleObject(groupBox);

            Assert.False(groupBox.IsHandleCreated);

            bool supportsLegacyIAccessiblePatternId = groupBoxAccessibleObject.IsPatternSupported(Interop.UiaCore.UIA.LegacyIAccessiblePatternId);

            Assert.True(supportsLegacyIAccessiblePatternId);
        }
        public void GroupBoxAccessibleObject_LegacyIAccessible_Role_ReturnsExpected()
        {
            using var groupBox      = new GroupBox();
            groupBox.Name           = "Group1";
            groupBox.Text           = "Some test groupBox text";
            groupBox.AccessibleRole = AccessibleRole.Link;
            var groupBoxAccessibleObject = new GroupBox.GroupBoxAccessibleObject(groupBox);

            // Will fail when https://github.com/dotnet/winforms/pull/3432 is merged.
            // Assert.False is expected here
            Assert.True(groupBox.IsHandleCreated);

            Assert.Equal(AccessibleRole.Link, groupBoxAccessibleObject.Role);
        }
        public void GroupBoxAccessibleObject_IsPatternSupported_LegacyIAccessible_ReturnsTrue()
        {
            using var groupBox = new GroupBox();
            groupBox.Name      = "Group1";
            groupBox.Text      = "Some test groupBox text";
            var groupBoxAccessibleObject = new GroupBox.GroupBoxAccessibleObject(groupBox);

            // Will fail when https://github.com/dotnet/winforms/pull/3432 is merged.
            // Assert.False is expected here
            Assert.True(groupBox.IsHandleCreated);

            bool supportsLegacyIAccessiblePatternId = groupBoxAccessibleObject.IsPatternSupported(Interop.UiaCore.UIA.LegacyIAccessiblePatternId);

            Assert.True(supportsLegacyIAccessiblePatternId);
        }
        public void GroupBoxAccessibleObject_LegacyIAccessible_Description_ReturnsExpected()
        {
            string testAccDescription = "Test description";

            using var groupBox             = new GroupBox();
            groupBox.Name                  = "Group1";
            groupBox.Text                  = "Some test groupBox text";
            groupBox.AccessibleDescription = testAccDescription;
            var groupBoxAccessibleObject = new GroupBox.GroupBoxAccessibleObject(groupBox);

            // Will fail when https://github.com/dotnet/winforms/pull/3432 is merged.
            // Assert.False is expected here
            Assert.True(groupBox.IsHandleCreated);

            Assert.Equal(testAccDescription, groupBoxAccessibleObject.Description);
        }