From ad461510b164b5361def40461e9ed99a0504febc Mon Sep 17 00:00:00 2001 From: Todd Date: Fri, 8 Dec 2023 16:37:44 -0600 Subject: [PATCH] coverlet complaining again it's getting more and more tempting to exclude Newtonsoft from requirements :) --- test/Flurl.Test/Http/NewtonsoftTests.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/Flurl.Test/Http/NewtonsoftTests.cs b/test/Flurl.Test/Http/NewtonsoftTests.cs index ed940079..34aed71d 100644 --- a/test/Flurl.Test/Http/NewtonsoftTests.cs +++ b/test/Flurl.Test/Http/NewtonsoftTests.cs @@ -1,4 +1,5 @@ using System; +using System.Net.Http; using NUnit.Framework; using Flurl.Http; using Flurl.Http.Newtonsoft; @@ -6,6 +7,7 @@ using System.Threading.Tasks; using Flurl.Http.Configuration; using Newtonsoft.Json; +using NUnit.Framework.Constraints; namespace Flurl.Test.Http { @@ -55,6 +57,14 @@ public async Task null_response_returns_null_dynamic() { var list = await resp.ReceiveJsonList(); Assert.IsNull(list); + + var ex = new FlurlHttpException(new FlurlCall { + Request = new FlurlRequest(), + HttpRequestMessage = new HttpRequestMessage(), + Response = null, + }); + var err = await ex.GetResponseJsonAsync(); + Assert.IsNull(err); } [TestCase(false)]