Пример #1
0
        public async Task When_Text_Changed_Should_Reflect_In_DataTemplate_TextBox()
        {
            var SUT = new AutoSuggestBox();

            SUT.Text = "New text..";
            WindowHelper.WindowContent = SUT;
            await WindowHelper.WaitForIdle();

            var textBox = (TextBox)SUT.GetTemplateChild("TextBox");

            textBox.Text.Should().Be("New text..");
        }
Пример #2
0
        public async Task When_Text_Changed_And_Not_Focused_Should_Not_Open_Suggestion_List()
        {
            var SUT = new AutoSuggestBox();

            SUT.ItemsSource = new List <string>()
            {
                "ab", "abc", "abcde"
            };
            WindowHelper.WindowContent = SUT;
            await WindowHelper.WaitForIdle();

            var textBox = (TextBox)SUT.GetTemplateChild("TextBox");

            textBox.IsFocused.Should().BeFalse();
            SUT.Text = "a";
            SUT.IsSuggestionListOpen.Should().BeFalse();
        }