public void FindUpcoming_Should_Return_Paged_Result() { using (BeginTransaction()) { GenerateStories(false, true, true); _database.SubmitChanges(); var pagedResult = _storyRepository.FindUpcoming(0, 5); Assert.Equal(5, pagedResult.Result.Count); Assert.True(pagedResult.Total >= 10); } }
public void FindUpcoming_Should_Return_Paged_Result() { var story1 = CreateStory(); var story2 = CreateStory(); var story3 = CreateStory(); Stories.AddRange(new[] { story1 as Story, story2 as Story, story3 as Story }); var pagedResult = _storyRepository.FindUpcoming(0, 10); Assert.Equal(3, pagedResult.Result.Count); Assert.Equal(3, pagedResult.Total); }
private void AddStoriesInRegularSiteMap(HttpContextBase context, bool forMobile, XContainer target) { Action <IStory> addStory = story => target.Add(CreateEntry(context, Settings.RootUrl, "Detail", new { name = story.UniqueName }, story.LastActivityAt, SiteMapChangeFrequency.Weekly, SiteMapUpdatePriority.Critical, forMobile)); ICollection <IStory> publishedStories = StoryRepository.FindPublished(0, PublishedStoryMaxCount).Result; foreach (IStory story in publishedStories) { addStory(story); } ICollection <IStory> upcomingStories = StoryRepository.FindUpcoming(0, UpcomingStoryMaxCount).Result; foreach (IStory story in upcomingStories) { addStory(story); } }