У меня есть следующий модульный тест для некоторого пейджинга с LINQ:
Код: Выделить всё
// Arrange.
const int locationId = 1;
const LocationType locationType = LocationType.City;
int pageSize = 10;
// Act.
var postsPageOne = PostService.FindAllPostsForLocationPaged(locationId, locationType, 1, pageSize);
var postsPageTwo = PostService.FindAllPostsForLocationPaged(locationId, locationType, 2, pageSize);
// Assert.
Assert.IsTrue(postsPageOne.Count > 0);
Assert.IsTrue(postsPageTwo.Count > 0);
Assert.AreEqual(postsPageOne.Count, pageSize);
Assert.AreEqual(postsPageTwo.Count, pageSize);
CollectionAssert.AllItemsAreNotNull(postsPageOne.ToArray());
CollectionAssert.AllItemsAreNotNull(postsPageTwo.ToArray());
Есть идеи, как это можно сделать?
Подробнее здесь: https://stackoverflow.com/questions/381 ... s-differen