Skip to content

Commit

Permalink
- Fix parameter set serialization (remove unneeded null check for leg…
Browse files Browse the repository at this point in the history
…acy feature) (#513)
  • Loading branch information
nwithan8 authored Aug 31, 2023
1 parent 0b93bc1 commit 28dbb2b
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 100 deletions.
18 changes: 15 additions & 3 deletions EasyPost.Tests/ServicesTests/ServiceTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using EasyPost.Exceptions.General;
Expand Down Expand Up @@ -33,10 +34,21 @@ public async Task TestGetNextPage()

AddressCollection addressCollection = await Client.Address.All(new Dictionary<string, object> { { "page_size", Fixtures.PageSize } });

AddressCollection nextPageAddressCollection = await Client.Address.GetNextPage(addressCollection);
string firstId = addressCollection.Addresses[0].Id;

// If the first ID in the next page is the same as the first ID in the current page, then we didn't get the next page
Assert.NotEqual(addressCollection.Addresses[0].Id, nextPageAddressCollection.Addresses[0].Id);
foreach (int _ in Enumerable.Range(0, 3))
{
if (addressCollection.HasMore is false or null)
{
break;
}

addressCollection = await Client.Address.GetNextPage(addressCollection);
// If the first ID in the next page is the same as the first ID in the current page, then we didn't get the next page
Assert.NotEqual(firstId, addressCollection.Addresses[0].Id);

firstId = addressCollection.Addresses[0].Id;
}
}

/// <summary>
Expand Down
138 changes: 116 additions & 22 deletions EasyPost.Tests/cassettes/net/base_service/get_next_page.json

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 28dbb2b

Please sign in to comment.