public void Sort_Videos_By_Creation_Date_No_Parameters() { // Perform the API call BrightcoveItemCollection <BrightcoveVideo> videos = Api.SearchVideos(new List <FieldValuePair>(), new List <FieldValuePair>(), new List <FieldValuePair>()); BrightcoveVideo firstVideo = videos.First(); BrightcoveVideo expectedFirstVideo = AllVideos.OrderBy(x => x.CreationDate) .First(); BrightcoveVideo lastVideoOnPage = videos.Last(); BrightcoveVideo expectedLastVideoInRange = AllVideos.OrderBy(x => x.CreationDate) .Skip(videos.PageSize - 1) .First(); Assert.AreEqual(expectedFirstVideo.Id, firstVideo.Id); Assert.AreEqual(expectedLastVideoInRange.Id, lastVideoOnPage.Id); }
public void Sort_Videos_By_Creation_Date_Desc_No_Parameters() { // Perform the API call BrightcoveItemCollection <BrightcoveVideo> videos = Api.SearchVideos(new List <FieldValuePair>(), new List <FieldValuePair>(), new List <FieldValuePair>(), 100, 0, false, SortBy.CreationDate, SortOrder.Descending); BrightcoveVideo firstVideo = videos.First(); BrightcoveVideo expectedFirstVideo = AllVideos.OrderByDescending(x => x.CreationDate) .First(); BrightcoveVideo lastVideoOnPage = videos.Last(); BrightcoveVideo expectedLastVideoInRange = AllVideos.OrderByDescending(x => x.CreationDate) .Skip(videos.PageSize - 1) .First(); Assert.AreEqual(videos.TotalCount, AllVideos.Count); Assert.AreEqual(expectedFirstVideo.Id, firstVideo.Id); }