Exemple #1
0
        public void RadioButtonAccessibleObject_GetProperyValue_LegacyIAccessibleDefaultActionPropertyId_ReturnsExpected()
        {
            using var radioButton = new RadioButton
                  {
                      AccessibleDefaultActionDescription = "TestActionDescription"
                  };

            var radioButtonAccessibleObject = new RadioButton.RadioButtonAccessibleObject(radioButton);

            Assert.Equal("TestActionDescription", radioButtonAccessibleObject.GetPropertyValue(UIA.LegacyIAccessibleDefaultActionPropertyId));
            Assert.False(radioButton.IsHandleCreated);
        }
Exemple #2
0
        public void RadioButtonAccessibleObject_GetPropertyValue_Invoke_ReturnsExpected(int propertyID, object expected)
        {
            using var radioButton = new RadioButton
                  {
                      Name           = "RadioButton1",
                      AccessibleName = "TestName"
                  };

            Assert.False(radioButton.IsHandleCreated);
            var    radioButtonAccessibleObject = new RadioButton.RadioButtonAccessibleObject(radioButton);
            object value = radioButtonAccessibleObject.GetPropertyValue((UIA)propertyID);

            Assert.Equal(expected, value);
            Assert.False(radioButton.IsHandleCreated);
        }
        public void RadioButtonAccessibleObject_GetPropertyValue_Invoke_ReturnsExpected(int propertyID, object expected)
        {
            using var radioButton = new RadioButton
                  {
                      Name           = "RadioButton1",
                      AccessibleName = "TestName"
                  };

            Assert.False(radioButton.IsHandleCreated);
            var    radioButtonAccessibleObject = new RadioButton.RadioButtonAccessibleObject(radioButton);
            object value = radioButtonAccessibleObject.GetPropertyValue((UIA)propertyID);

            Assert.Equal(expected, value);
            // TODO: ControlAccessibleObject shouldn't force handle creation, tracked in https://github.com/dotnet/winforms/issues/3062
            Assert.True(radioButton.IsHandleCreated);
        }