Exemplo n.º 1
0
        public void ICursor_Batch_ToList_IsTrue()
        {
            var table = base.GetTable();

            using (ComReleaser cr = new ComReleaser())
            {
                IQueryFilter filter = new QueryFilterClass();
                filter.WhereClause = table.OIDFieldName + "< 10";

                ICursor cursor = table.Search(filter, false);
                cr.ManageLifetime(cursor);

                var batches = cursor.Batch(2).ToList();
                Assert.AreEqual(batches.Count(), 5);

                int count = batches.Sum(batch => batch.Count());
                Assert.IsTrue(count < 10);
            }
        }