public void ButtonAccessibleObject_Ctor_InitializesOwner() { using var button = new Button(); Assert.False(button.IsHandleCreated); var buttonAccessibleObject = new Button.ButtonAccessibleObject(button); Assert.Same(button, buttonAccessibleObject.Owner); Assert.False(button.IsHandleCreated); }
public void ButtonAccessibleObject_IsPatternSupported_Invoke_ReturnsTrue_ForLegacyIAccessiblePatternId() { using var button = new Button(); Assert.False(button.IsHandleCreated); var buttonAccessibleObject = new Button.ButtonAccessibleObject(button); Assert.True(buttonAccessibleObject.IsPatternSupported(UIA.LegacyIAccessiblePatternId)); Assert.False(button.IsHandleCreated); }
public void ButtonAccessibleObject_Ctor_InitializesOwner() { using var button = new Button(); Assert.False(button.IsHandleCreated); var buttonAccessibleObject = new Button.ButtonAccessibleObject(button); Assert.Same(button, buttonAccessibleObject.Owner); // TODO: ControlAccessibleObject should not force handle creation, tracked in https://github.com/dotnet/winforms/issues/3062 Assert.True(button.IsHandleCreated); }
public void ButtonAccessibleObject_IsPatternSupported_Invoke_ReturnsTrue_ForLegacyIAccessiblePatternId() { using var button = new Button(); Assert.False(button.IsHandleCreated); var buttonAccessibleObject = new Button.ButtonAccessibleObject(button); Assert.True(buttonAccessibleObject.IsPatternSupported(UIA.LegacyIAccessiblePatternId)); // TODO: ControlAccessibleObject should not force handle creation, tracked in https://github.com/dotnet/winforms/issues/3062 Assert.True(button.IsHandleCreated); }
public void ButtonAccessibleObject_AccessibleRole_Custom_ReturnsExpected() { using var button = new Button { AccessibleRole = AccessibleRole.Link }; Assert.False(button.IsHandleCreated); var buttonAccessibleObject = new Button.ButtonAccessibleObject(button); Assert.Equal(AccessibleRole.Link, buttonAccessibleObject.Role); Assert.False(button.IsHandleCreated); }
public void ButtonAccessibleObject_AccessibleRole_Custom_ReturnsExpected() { using var button = new Button { AccessibleRole = AccessibleRole.Link }; Assert.False(button.IsHandleCreated); var buttonAccessibleObject = new Button.ButtonAccessibleObject(button); Assert.Equal(AccessibleRole.Link, buttonAccessibleObject.Role); // TODO: ControlAccessibleObject should not force handle creation, tracked in https://github.com/dotnet/winforms/issues/3062 Assert.True(button.IsHandleCreated); }
public void ButtonAccessibleObject_GetPropertyValue_Invoke_ReturnsExpected(int propertyID, object expected) { using var button = new Button { Name = "Button1", AccessibleName = "TestName" }; Assert.False(button.IsHandleCreated); var buttonAccessibleObject = new Button.ButtonAccessibleObject(button); object value = buttonAccessibleObject.GetPropertyValue((UIA)propertyID); Assert.Equal(expected, value); Assert.False(button.IsHandleCreated); }
public void ButtonAccessibleObject_GetPropertyValue_Invoke_ReturnsExpected(int propertyID, object expected) { using var button = new Button { Name = "Button1", AccessibleName = "TestName" }; Assert.False(button.IsHandleCreated); var buttonAccessibleObject = new Button.ButtonAccessibleObject(button); object value = buttonAccessibleObject.GetPropertyValue((UIA)propertyID); Assert.Equal(expected, value); // TODO: ControlAccessibleObject should not force handle creation, tracked in https://github.com/dotnet/winforms/issues/3062 Assert.True(button.IsHandleCreated); }
public void ButtonAccessibleObject_AccessibleRole_Default_ReturnsExpected(bool createControl, AccessibleRole accessibleRole) { using var button = new Button { AccessibleRole = AccessibleRole.Default }; if (createControl) { button.CreateControl(); } var buttonAccessibleObject = new Button.ButtonAccessibleObject(button); Assert.Equal(accessibleRole, buttonAccessibleObject.Role); Assert.Equal(createControl, button.IsHandleCreated); }