public void RadioButtonAccessibleObject_IsItemSelected_ReturnsExpected(bool createControl) { using var radioButton = new RadioButton(); if (createControl) { radioButton.CreateControl(); } var radioButtonAccessibleObject = new RadioButton.RadioButtonAccessibleObject(radioButton); Assert.False(radioButtonAccessibleObject.IsItemSelected); radioButtonAccessibleObject.DoDefaultAction(); Assert.Equal(createControl, radioButtonAccessibleObject.IsItemSelected); Assert.Equal(createControl, radioButton.IsHandleCreated); }
public void RadioButtonAccessibleObject_State_ReturnsExpected(bool createControl, AccessibleStates accessibleStatesFirstStage, AccessibleStates accessibleStatesSecondStage) { using var radioButton = new RadioButton(); if (createControl) { radioButton.CreateControl(); } var radioButtonAccessibleObject = new RadioButton.RadioButtonAccessibleObject(radioButton); Assert.Equal(accessibleStatesFirstStage, radioButtonAccessibleObject.State); radioButtonAccessibleObject.DoDefaultAction(); Assert.Equal(accessibleStatesSecondStage, radioButtonAccessibleObject.State); Assert.Equal(createControl, radioButton.IsHandleCreated); }