コード例 #1
0
            public async Task ReturnsNullIfNotFound()
            {
                var authorId = -1;
                var books    = await BooksEndpoint.GetListByAuthorId(authorId);

                Assert.Null(books);
            }
コード例 #2
0
            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);
            }
コード例 #3
0
            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);
            }