Example #1
0
        public void CorrectlyBuildSuggestionList(TestFilterSourceList filterSourceList)
        {
            var target = Target;
            var model  = target.Current;

            model.FilterSource = filterSourceList;
            model.PropertyName = nameof(TestFilterSource.Prop1);

            var suggestionList = target.OpenSuggestionList();

            CollectionAssert.AreEquivalent(suggestionList, filterSourceList.Select(x => x.Prop1));
        }
Example #2
0
        public void CorrectlySelectItemFromSuggestionList(TestFilterSourceList filterSourceList)
        {
            var target = Target;
            var model  = target.Current;

            model.FilterSource = filterSourceList;
            model.PropertyName = nameof(TestFilterSource.Prop1);

            var item = filterSourceList[filterSourceList.Count / 2].Prop1;

            target.SelectItemFromSuggestionList(item);

            Assert.That(item, Is.EqualTo(target.Text));
            Assert.That(item, Is.EqualTo(model.Text));
        }
Example #3
0
        public void CorrectlyFilterSuggestionList(TestFilterSourceList filterSourceList)
        {
            var target = Target;
            var model  = target.Current;

            model.FilterSource = filterSourceList;
            model.PropertyName = nameof(TestFilterSource.Prop1);

            const string inputText = "o";

            target.Text = inputText;

            var filteredList = filterSourceList.Where(x => x.Prop1.Contains(inputText))
                               .ToList();

            var suggestionList = target.OpenSuggestionList();

            CollectionAssert.AreEquivalent(suggestionList, filteredList.Select(x => x.Prop1));
        }
Example #4
0
        public void CorrectlyBuildSuggestionListAfterClearingContents(TestFilterSourceList filterSourceList)
        {
            var target = Target;
            var model  = target.Current;

            model.FilterSource = filterSourceList;
            model.PropertyName = nameof(TestFilterSource.Prop1);

            target.Text = "Test value";

            Wait.UntilResponsive();

            target.Clear();

            Wait.UntilResponsive();

            var suggestionList = target.OpenSuggestionList();

            CollectionAssert.AreEquivalent(suggestionList, filterSourceList.Select(x => x.Prop1));
        }