public void TextBoxBaseUiaTextProvider_EditStyle_ReturnsCorrectValue()
        {
            using TextBoxBase textBoxBase = new SubTextBoxBase();
            textBoxBase.CreateControl();
            TextBoxBaseUiaTextProvider provider = new TextBoxBaseUiaTextProvider(textBoxBase);
            ES actual = provider.EditStyle;

            Assert.True(actual.HasFlag(ES.LEFT));
            Assert.True(actual.HasFlag(ES.AUTOVSCROLL));
            Assert.True(actual.HasFlag(ES.AUTOHSCROLL));
            Assert.True(textBoxBase.IsHandleCreated);
        }
        public void UiaTextProvider_GetEditStyle_DoesntContainMultilineStyle_ForSinglelineTextBox()
        {
            // EditControl Multiline is false when EditControl doesn't have ES_MULTILINE style
            using EditControl textBox = new EditControl(
                      editStyle: ES.LEFT | ES.AUTOHSCROLL | ES.AUTOVSCROLL,
                      style: WS.OVERLAPPED | WS.VISIBLE);
            Mock <UiaTextProvider> providerMock = new Mock <UiaTextProvider>(MockBehavior.Strict);

            ES actual = providerMock.Object.GetEditStyle(textBox);

            Assert.False(actual.HasFlag(ES.MULTILINE));
        }
Esempio n. 3
0
        public void UiaTextProvider_GetEditStyle_ContainsMultilineStyle_ForMultilineTextBox()
        {
            // EditControl Multiline is true when EditControl has ES_MULTILINE style
            using EditControl textBox = new EditControl(
                      editStyle: ES.MULTILINE | ES.LEFT | ES.AUTOHSCROLL | ES.AUTOVSCROLL,
                      style: WS.OVERLAPPED | WS.VISIBLE);
            Mock <UiaTextProvider> providerMock = new Mock <UiaTextProvider>(MockBehavior.Strict);

            ES actual = UiaTextProvider.GetEditStyle(textBox);

            Assert.True(actual.HasFlag(ES.MULTILINE));
        }