Skip to content

Commit ed4bde5

Browse files
committed
fix: update test to properly handle JSON deserialization with JArray/JObject
1 parent e34f179 commit ed4bde5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

EasyPost.Tests/ClientTest.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
using EasyPost.Exceptions.API;
99
using EasyPost.Tests._Utilities;
1010
using EasyPost.Tests._Utilities.Attributes;
11+
using Newtonsoft.Json.Linq;
1112
using Xunit;
12-
using CustomAssertions = EasyPost.Tests._Utilities.Assertions.Assert;
1313

1414
namespace EasyPost.Tests
1515
{
@@ -316,8 +316,10 @@ public async Task TestClientMakeApiCall()
316316

317317
Dictionary<string, object> response = await Client.MakeApiCallAsync(Http.Method.Get, "/addresses", parameters);
318318

319-
Assert.NotNull(response);
320-
Assert.True(response.ContainsKey("addresses"));
319+
JArray addresses = response["addresses"] as JArray;
320+
Assert.Single(addresses);
321+
JObject firstAddress = addresses[0] as JObject;
322+
Assert.Equal("Address", firstAddress["object"].ToString());
321323
}
322324
}
323325
}

0 commit comments

Comments
 (0)