// ReSharper disable once UnusedParameter.Local
        private static bool TryGetBlockAtSlow(long index, out DataBlock?block, out int blockIndex)
        {
            using (var bc = new BlockCursor <TKey, int, BaseContainer <TKey> >())
            {
                if (bc.Move(index, false) == 0)
                {
                    block      = null;
                    blockIndex = -1;
                    return(false);
                }

                block      = bc.CurrentBlock;
                blockIndex = bc.BlockIndex;
                return(true);
            }
        }
Beispiel #2
0
        public void CouldMoveNext()
        {
            var count = 100;
            var len   = count / 2;
            var bc    = CreateIntBaseContainer(count, len);
            var c     = new BlockCursor <int, object, BaseContainer <int> >(bc);

            for (int i = 0; i < len; i++)
            {
                Assert.IsTrue(c.MoveNext());
                Assert.AreEqual(i, c._blockPosition);
            }

            Assert.AreEqual(1 - len, c.Move(long.MinValue, true));

            bc.Dispose();
        }