public async Task ReturnsNullIfNotFound() { var authorId = -1; var books = await BooksEndpoint.GetListByAuthorId(authorId); Assert.Null(books); }
public async Task ReturnsBooks() { var authorId = 38550; var books = await BooksEndpoint.GetListByAuthorId(authorId); Assert.NotNull(books); Assert.NotEmpty(books.List); Assert.True(books.Pagination.TotalItems > 0); Assert.Contains(books.List.First().Authors, x => x.Id == authorId); }
public async Task ReturnsASecondPage() { var authorId = 38550; var books = await BooksEndpoint.GetListByAuthorId(authorId, page : 2); Assert.NotNull(books); Assert.NotEmpty(books.List); Assert.True(books.Pagination.TotalItems > 0); Assert.True(books.Pagination.Start == 31); }