public void PropertyGridAccessibleObject_Ctor_Default()
        {
            using PropertyGrid propertyGrid = new PropertyGrid();
            PropertyGridAccessibleObject accessibleObject = new PropertyGridAccessibleObject(propertyGrid);

            Assert.NotNull(accessibleObject.Owner);
            Assert.Equal(propertyGrid, accessibleObject.Owner);
        }
        public void PropertyGridAccessibleObject_SupportsPattern(int pattern)
        {
            using PropertyGrid propertyGrid = new PropertyGrid();
            using ComboBox comboBox         = new ComboBox();
            propertyGrid.SelectedObject     = comboBox;
            PropertyGridAccessibleObject propertyGridAccessibleObject = new PropertyGridAccessibleObject(propertyGrid);

            // First child should be PropertyGrid toolbox.
            AccessibleObject firstChild = (AccessibleObject)propertyGridAccessibleObject.FragmentNavigate(UiaCore.NavigateDirection.FirstChild);

            // Second child entry should be PropertyGridView.
            AccessibleObject gridViewChild = (AccessibleObject)firstChild.FragmentNavigate(UiaCore.NavigateDirection.NextSibling);

            Assert.True(gridViewChild.IsPatternSupported((UiaCore.UIA)pattern));
        }
        public void PropertyGridAccessibleObject_Supports_TablePattern(int pattern)
        {
            PropertyGrid propertyGrid = new PropertyGrid();
            ComboBox     comboBox     = new ComboBox();

            propertyGrid.SelectedObject = comboBox;

            var propertyGridAccessibleObject = new PropertyGridAccessibleObject(propertyGrid);

            // First child should be PropertyGrid toolbox.
            var firstChild = propertyGridAccessibleObject.FragmentNavigate(UiaCore.NavigateDirection.FirstChild) as AccessibleObject;

            // Second child entry should be PropertyGridView.
            var gridViewChild = firstChild.FragmentNavigate(UiaCore.NavigateDirection.NextSibling) as AccessibleObject;

            Assert.True(gridViewChild.IsPatternSupported(((UiaCore.UIA)pattern)));
        }