Ejemplo n.º 1
0
        private void btnFilterSubmit_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(SearchQuery))
            {
                return;
            }

            Func <IEnumerable <Series> > getResult = () => db.Filter(SearchQuery, Limit, CaseSensitive);

            ShowFilteredForm = new FilteredForm(db, SearchQuery, getResult).ShowDialog;
            DialogResult     = DialogResult.OK;
            Close();
        }
Ejemplo n.º 2
0
        public void Filter(bool sen, bool order)
        {
            var arg      = list[rand(0, 10)];
            var lim      = rand(1, 10);
            var trimEnd  = arg.Name.Substring(0, arg.Name.Length - 5);
            var filtered = db.Filter(trimEnd, lim, sen, order);

            Assert.GreaterOrEqual(lim, filtered.Count());
            Assert.IsTrue(filtered.Any(f => f.Id == arg.Id));
            foreach (var item in filtered)
            {
                if (sen)
                {
                    Assert.IsTrue(item.Name.Contains(trimEnd));
                }
                else
                {
                    Assert.IsTrue(item.Name.ToLower().Contains(trimEnd.ToLower()));
                }
            }
        }