public async Task ReturnsSortedList() { var reviews = await ReviewsClient.GetListByUser( ReviewsUserId, sort : SortReviewsList.AverageRating, order : Order.Descending); Assert.NotNull(reviews); Review previousReview = null; foreach (var currentReview in reviews.List) { Assert.NotNull(currentReview); Assert.NotNull(currentReview.Book); Assert.NotNull(currentReview.Book.AverageRating); if (previousReview != null) { Assert.True(previousReview.Book.AverageRating >= currentReview.Book.AverageRating); } previousReview = currentReview; } }
public async Task ReturnsSortedList() { var reviews = await ReviewsClient.GetListByUser( ReviewsUserId, sort : SortReviewsList.AverageRating, order : Order.Descending); Assert.NotNull(reviews); Review previousReview = null; foreach (var currentReview in reviews.List) { Assert.NotNull(currentReview); Assert.NotNull(currentReview.Book); Assert.NotNull(currentReview.Book.AverageRating); if (previousReview != null) { // TODO: Goodreads is currently returning sorted lists wrong. Disable this // assertion for now until they hopefully fix it in the future. // Assert.True(previousReview.Book.AverageRating >= currentReview.Book.AverageRating); } previousReview = currentReview; } }
public async Task ReturnsCorrectPageSize() { var expectedPageSize = 42; var reviews = await ReviewsClient.GetListByUser(ReviewsUserId, pageSize : expectedPageSize); Assert.NotNull(reviews); Assert.Equal(reviews.Pagination.End, expectedPageSize); Assert.Equal(reviews.List.Count, expectedPageSize); }
public async Task ReturnsReviews() { var reviews = await ReviewsClient.GetListByUser(ReviewsUserId); Assert.NotNull(reviews); }