public async Task ShouldReturnNullIfAtEnd()
            {
                var records = RecordCreator.CreateRecords(5);
                var cursor  = new ListBasedRecordCursor(new[] { "key0" }, () => records);

                // [0, 1, 2, 3]
                await cursor.FetchAsync();

                await cursor.FetchAsync();

                await cursor.FetchAsync();

                await cursor.FetchAsync();

                var record = await cursor.PeekAsync();

                record.Should().NotBeNull();
                record[0].As <string>().Should().Be("record4:key0");

                var moveNext = await cursor.FetchAsync();

                moveNext.Should().BeTrue();

                record.Should().NotBeNull();
                record[0].As <string>().Should().Be("record4:key0");

                record = await cursor.PeekAsync();

                record.Should().BeNull();
            }
            public async Task ShouldBeTheSameWithEnumeratorMoveNextCurrent()
            {
                var records = RecordCreator.CreateRecords(2);
                var cursor  = new ListBasedRecordCursor(new[] { "key0" }, () => records);

                IRecord record;
                bool    hasNext;

                for (int i = 0; i < 2; i++)
                {
                    record = await cursor.PeekAsync();

                    record.Should().NotBeNull();
                    record[0].As <string>().Should().Be($"record{i}:key0");

                    hasNext = await cursor.FetchAsync();

                    hasNext.Should().BeTrue();

                    // peeked record = current
                    cursor.Current[0].As <string>().Should().Be($"record{i}:key0");
                }

                record = await cursor.PeekAsync();

                record.Should().BeNull();

                hasNext = await cursor.FetchAsync();

                hasNext.Should().BeFalse();
            }
            public async Task ShouldReturnNextRecordWithoutMovingCurrentRecord()
            {
                var records = RecordCreator.CreateRecords(5);
                var cursor  = new ListBasedRecordCursor(new[] { "key1" }, () => records);

                var record = await cursor.PeekAsync();

                record.Should().NotBeNull();
                record[0].As <string>().Should().Be("record0:key0");

                // not moving further no matter how many times are called
                record = await cursor.PeekAsync();

                record.Should().NotBeNull();
                record[0].As <string>().Should().Be("record0:key0");
            }