Пример #1
0
        public async Task GetRightCount_ReturnMustRightSize(int size, int index)
        {
            var cur = CreateCursor(size);
            await cur.MoveAsync(index);

            var right = Math.Max(0, size - index - 1);

            Assert.AreEqual(right, DataCursorExtensions.RightCount(cur));
        }
Пример #2
0
 public void GivenNullValue_MustThrowException()
 {
     Assert.ThrowsException <ArgumentNullException>(() => DataCursorExtensions.IsEnd <object>(null));
     Assert.ThrowsException <ArgumentNullException>(() => DataCursorExtensions.IsFirst <object>(null));
     Assert.ThrowsException <ArgumentNullException>(() => DataCursorExtensions.IsInRange <object>(null, 0));
     Assert.ThrowsException <ArgumentNullException>(() => DataCursorExtensions.MoveFirstAsync <object>(null));
     Assert.ThrowsException <ArgumentNullException>(() => DataCursorExtensions.MoveLastAsync <object>(null));
     Assert.ThrowsException <ArgumentNullException>(() => DataCursorExtensions.MoveNextAsync <object>(null));
     Assert.ThrowsException <ArgumentNullException>(() => DataCursorExtensions.MovePrevAsync <object>(null));
     Assert.ThrowsException <ArgumentNullException>(() => DataCursorExtensions.RightCount <object>(null));
 }