SEEK.AdPostingApi.Client.Resources.AdvertisementSummaryPageResource.NextPageAsync C# (CSharp) Method

NextPageAsync() public method

public NextPageAsync ( ) : Task
return Task
        public async Task<AdvertisementSummaryPageResource> NextPageAsync()
        {
            if (this.Eof)
            {
                throw new NotSupportedException("There are no more results");
            }

            return await this._client.GetResourceAsync<AdvertisementSummaryPageResource>(this.Links.GenerateLink("next"));
        }
    }

Usage Example

        public async Task GetAllAdvertisementsNoNextPage()
        {
            AdvertisementSummaryPageResource pageResource = new AdvertisementSummaryPageResource
            {
                Links = new Links(this.Fixture.AdPostingApiServiceBaseUri)
                {
                    { "self", new Link { Href = "/advertisement" } }
                }
            };

            var actualException = await Assert.ThrowsAsync<NotSupportedException>(async () => await pageResource.NextPageAsync());
            var expectedException = new NotSupportedException("There are no more results");

            actualException.ShouldBeEquivalentToException(expectedException);
        }
All Usage Examples Of SEEK.AdPostingApi.Client.Resources.AdvertisementSummaryPageResource::NextPageAsync
AdvertisementSummaryPageResource