Exemplo n.º 1
0
        public void Reduce_CriteriaByValues_ShouldReturnSubset()
        {
            var rows   = SiteRankingCollections.First10000Rows.OrderBy(x => x.TopLevelDomain).ToArray();
            var search = new SiteRankingSearch {
                TopLevelDomain = SearchCriteria.ByValues("ca", "com")
            };
            var criteria = BuildCriteria(rows, search);
            var expected = rows.Where(x => x.TopLevelDomain == "ca" || x.TopLevelDomain == "com");
            var actual   = criteria.Reduce(new BinarySearchTable <SiteRanking>(rows));

            CollectionAssert.AreEquivalent(expected.ToList(), actual.Materialize());
        }