Skip to content

Commit 28dbb2b

Browse files
authored
- Fix parameter set serialization (remove unneeded null check for legacy feature) (#513)
1 parent 0b93bc1 commit 28dbb2b

File tree

7 files changed

+291
-100
lines changed

7 files changed

+291
-100
lines changed

EasyPost.Tests/ServicesTests/ServiceTest.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Linq;
23
using System.Net;
34
using System.Threading.Tasks;
45
using EasyPost.Exceptions.General;
@@ -33,10 +34,21 @@ public async Task TestGetNextPage()
3334

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

36-
AddressCollection nextPageAddressCollection = await Client.Address.GetNextPage(addressCollection);
37+
string firstId = addressCollection.Addresses[0].Id;
3738

38-
// 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
39-
Assert.NotEqual(addressCollection.Addresses[0].Id, nextPageAddressCollection.Addresses[0].Id);
39+
foreach (int _ in Enumerable.Range(0, 3))
40+
{
41+
if (addressCollection.HasMore is false or null)
42+
{
43+
break;
44+
}
45+
46+
addressCollection = await Client.Address.GetNextPage(addressCollection);
47+
// 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
48+
Assert.NotEqual(firstId, addressCollection.Addresses[0].Id);
49+
50+
firstId = addressCollection.Addresses[0].Id;
51+
}
4052
}
4153

4254
/// <summary>

EasyPost.Tests/cassettes/net/base_service/get_next_page.json

Lines changed: 116 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EasyPost.Tests/cassettes/net/base_service/get_next_page_size_limit.json

Lines changed: 22 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)