Skip to content

Commit

Permalink
Fix failing test due to change of behavior: empty body will cause a F…
Browse files Browse the repository at this point in the history
…lurlParsingException instead of returning null.
  • Loading branch information
rwasef1830 committed Jan 12, 2024
1 parent 7bf4ff9 commit 3a3fdaa
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/Flurl.Test/Http/TestingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,12 @@ public class TestingTests : HttpTestFixtureBase

// https://github.com/tmenier/Flurl/issues/175
[Test]
public async Task can_deserialize_default_response_more_than_once() {
var resp = await "http://www.api.com".GetJsonAsync<object>();
Assert.IsNull(resp);
public void can_deserialize_default_response_more_than_once()
{
Assert.ThrowsAsync<FlurlParsingException>(() => "http://www.api.com".GetJsonAsync<object>());
// bug: couldn't deserialize here due to reading stream twice
resp = await "http://www.api.com".GetJsonAsync<object>();
Assert.IsNull(resp);
resp = await "http://www.api.com".GetJsonAsync<object>();
Assert.IsNull(resp);
Assert.ThrowsAsync<FlurlParsingException>(() => "http://www.api.com".GetJsonAsync<object>());
Assert.ThrowsAsync<FlurlParsingException>(() => "http://www.api.com".GetJsonAsync<object>());
}

[Test]
Expand Down

0 comments on commit 3a3fdaa

Please sign in to comment.