public void TextBoxBaseUiaTextProvider_GetCaretRange_IsNull_IfHandleIsNotCreated()
        {
            using TextBoxBase textBoxBase = new SubTextBoxBase();
            TextBoxBaseUiaTextProvider provider = new TextBoxBaseUiaTextProvider(textBoxBase);

            UiaCore.ITextRangeProvider uiaTextRange = provider.GetCaretRange(out _);
            Assert.Null(uiaTextRange);
            Assert.False(textBoxBase.IsHandleCreated);
        }
        public void TextBoxBaseUiaTextProvider_RangeFromAnnotation_DoesntThrowAnException()
        {
            using TextBoxBase textBoxBase = new SubTextBoxBase();
            TextBoxBaseUiaTextProvider provider = new TextBoxBaseUiaTextProvider(textBoxBase);

            // RangeFromAnnotation doesn't throw an exception
            UiaCore.ITextRangeProvider range = provider.RangeFromAnnotation(textBoxBase.AccessibilityObject);
            // RangeFromAnnotation implementation can be changed so this test can be changed too
            Assert.NotNull(range);
        }
        public void TextBoxBaseUiaTextProvider_GetCaretRange_IsNotNull()
        {
            using TextBoxBase textBoxBase = new SubTextBoxBase();
            textBoxBase.CreateControl();
            TextBoxBaseUiaTextProvider provider = new TextBoxBaseUiaTextProvider(textBoxBase);

            UiaCore.ITextRangeProvider uiaTextRange = provider.GetCaretRange(out _);
            Assert.NotNull(uiaTextRange);
            Assert.True(textBoxBase.IsHandleCreated);
        }