public void Test_FdbKey_BatchedRange() { // we want numbers from 0 to 99 in 5 batches of 20 contiguous items each var query = FdbKey.BatchedRange(0, 100, 20); Assert.That(query, Is.Not.Null); var batches = query.ToArray(); Assert.That(batches, Is.Not.Null); Assert.That(batches.Length, Is.EqualTo(5)); Assert.That(batches, Is.All.Not.Null); // each batch should be an enumerable that will return 20 items each for (int i = 0; i < batches.Length; i++) { var items = batches[i].ToArray(); Assert.That(items, Is.Not.Null.And.Length.EqualTo(20)); for (int j = 0; j < items.Length; j++) { Assert.That(items[j], Is.EqualTo(j + i * 20)); } } }