public void PropertyDescriptorGridEntryAccessibleObject_ExpandCollapseState_collapsed_by_default()
        {
            using PropertyGrid propertyGrid = new PropertyGrid();
            TestPropertyDescriptorGridEntry propertyDescriptorGridEntryTestEntity = new TestPropertyDescriptorGridEntry(propertyGrid, null, false);
            AccessibleObject propertyDescriptorGridEntryAccessibleObject          = propertyDescriptorGridEntryTestEntity.AccessibilityObject;

            UiaCore.ExpandCollapseState expandCollapseState = propertyDescriptorGridEntryAccessibleObject.ExpandCollapseState;
            Assert.Equal(UiaCore.ExpandCollapseState.Collapsed, expandCollapseState);
        }
Exemplo n.º 2
0
        public void DateTimePickerAccessibleObject_ExpandCollapseState_ReturnsExpected(int expandCollapseState)
        {
            using DateTimePicker dateTimePicker = new();

            var expected         = (UiaCore.ExpandCollapseState)expandCollapseState;
            var accessibleObject = (DateTimePickerAccessibleObject)dateTimePicker.AccessibilityObject;

            dateTimePicker.TestAccessor().Dynamic._expandCollapseState = expected;

            UiaCore.ExpandCollapseState actual = accessibleObject.ExpandCollapseState;

            Assert.Equal(expected, actual);
            Assert.False(dateTimePicker.IsHandleCreated);
        }