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)); }
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)); }