public void TrackBarLastButtonAccessibleObject_Help_ReturnExpected(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, bool createControl, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl, value, minimum, maximum);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.Null(accessibleObject.Help);
            Assert.Equal(createControl, trackBar.IsHandleCreated);
        }
        public void TrackBarFirstButtonAccessibleObject_Name_ReturnIncreaseName(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, bool createControl, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl, value, minimum, maximum);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.Equal(SR.TrackBarLargeIncreaseButtonName, accessibleObject.Name);
            Assert.Equal(createControl, trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_InvokePattern_DoesNotSupport(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, bool createControl, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl, value, minimum, maximum);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.True(accessibleObject.IsPatternSupported(Interop.UiaCore.UIA.InvokePatternId));
            Assert.Equal(createControl, trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_DefaultAction_ReturnActionPress(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, bool createControl, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl, value, minimum, maximum);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.Equal(SR.AccessibleActionPress, accessibleObject.DefaultAction);
            Assert.Equal(createControl, trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_Bounds_ReturnsEmptyRectangle_IfHandleIsNotCreated(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl: false, value, minimum, maximum);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.Equal(Rectangle.Empty, accessibleObject.Bounds);
            Assert.False(trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_IsDisplayed_ReturnsFalse_OwnerInvisible(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl: true, value, minimum, maximum);
            trackBar.Visible        = false;
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.False(accessibleObject.IsDisplayed);
            Assert.True(trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_GetPropertyValue_IsEnabledProperty_ReturnsFalse_OwnerDisabled(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, bool createControl, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl, value, minimum, maximum);
            trackBar.Enabled        = false;
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.False((bool)accessibleObject.GetPropertyValue(UiaCore.UIA.IsEnabledPropertyId));
            Assert.Equal(createControl, trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_Role_ReturnExpected(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, bool createControl, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl, value, minimum, maximum);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);
            AccessibleRole accessibleRole = createControl ? AccessibleRole.PushButton : AccessibleRole.None;

            Assert.Equal(accessibleRole, accessibleObject.Role);
            Assert.Equal(createControl, trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_Invoke_DoesNotWork_IfHandleIsNotCreated(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl: false, value, minimum, maximum);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.Equal(value, trackBar.Value);

            accessibleObject.Invoke();

            Assert.Equal(value, trackBar.Value);
            Assert.False(trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_FragmentNavigate_ReturnsNull_IfHandleIsNotCreated(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl: false, value, minimum, maximum);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.Null(accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.Parent));
            Assert.Null(accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.PreviousSibling));
            Assert.Null(accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.NextSibling));
            Assert.Null(accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.FirstChild));
            Assert.Null(accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.LastChild));
            Assert.False(trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_State_ReturnExpected(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, bool createControl, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl, value, minimum, maximum);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);
            var bounds = accessibleObject.Bounds;
            AccessibleStates expectedState = accessibleObject.IsDisplayed || !trackBar.IsHandleCreated
                                                ? AccessibleStates.None
                                                : AccessibleStates.Invisible;

            Assert.Equal(expectedState, accessibleObject.State);
            Assert.Equal(createControl, trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_FragmentNavigate_ReturnsExpected_IfButtonIsDisplayed(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout, int minimum, int maximum, int value)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl: true, value, minimum, maximum);
            var trackBarAccessibleObject = (TrackBar.TrackBarAccessibleObject)trackBar.AccessibilityObject;

            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = trackBarAccessibleObject.LastButtonAccessibleObject;

            Assert.Equal(trackBarAccessibleObject, accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.Parent));
            Assert.Equal(trackBarAccessibleObject.ThumbAccessibleObject, accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.PreviousSibling));
            Assert.Null(accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.NextSibling));
            Assert.Null(accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.FirstChild));
            Assert.Null(accessibleObject.FragmentNavigate(Interop.UiaCore.NavigateDirection.LastChild));
            Assert.True(trackBar.IsHandleCreated);
        }
        public void TrackBarLastButtonAccessibleObject_Invoke_Increase_WorkCorrectly(Orientation orientation, RightToLeft rightToLeft, bool rightToLeftLayout)
        {
            using TrackBar trackBar = GetTrackBar(orientation, rightToLeft, rightToLeftLayout, createControl: true, value: 5, 0, 10);
            TrackBar.TrackBarLastButtonAccessibleObject accessibleObject = GetTrackBarLastButton(trackBar);

            Assert.Equal(5, trackBar.Value);

            accessibleObject.Invoke();

            Assert.Equal(8, trackBar.Value);

            accessibleObject.Invoke();

            Assert.Equal(10, trackBar.Value);

            accessibleObject.Invoke();

            Assert.Equal(10, trackBar.Value);
            Assert.True(trackBar.IsHandleCreated);
        }