public void StartOutOfRange() { var input = new List <int> { 1 }; PagingUtility.Paging(input, 2, 1); }
public void StartAtTheEndReturnsEmpty() { var input = new List <int> { 1, 2, 3 }; var result = PagingUtility.Paging(input, 3, 10); Assert.AreEqual(0, result.Count); }
public void ToLargeLimitResultInSizeOfList() { var input = new List <int> { 1 }; var result = PagingUtility.Paging(input, 2); AssertContains(result, 1); }
public void PageTo() { var input = new List <int> { 1, 2, 3, 4, 5 }; var result = PagingUtility.Paging(input, 2, 2); AssertContains(result, 3, 4); }
public void LimitsEntries() { var input = new List <int> { 1, 2, 3, 4, 5 }; var result = PagingUtility.Paging(input, 2); AssertContains(result, 1, 2); }
public void DoesOnlyActivateNeededItems() { MemoryStorage memoryFileSystem = new MemoryStorage(); StoreItems(memoryFileSystem); IObjectContainer container = NewDB(memoryFileSystem); var counter = ActivationCounter(container); // #example: Use the paging utility IList <StoredItems> queryResult = container.Query <StoredItems>(); IList <StoredItems> pagedResult = PagingUtility.Paging(queryResult, 2, 2); // #end example foreach (StoredItems storedItems in pagedResult) { } Assert.AreEqual(2, counter.Value); }