From 16e0b841e7a0b96844264ff05fde5c5bde126d9a Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Thu, 10 Aug 2023 03:08:35 +0200 Subject: [PATCH] style: fix a few code style/static analysis warning CS8620 --- test/MockHttp.Tests/Extensions/HttpContentExtensionsTests.cs | 2 +- .../Extensions/RequestMatchingExtensionsTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/MockHttp.Tests/Extensions/HttpContentExtensionsTests.cs b/test/MockHttp.Tests/Extensions/HttpContentExtensionsTests.cs index e35e2346..6fe68b94 100644 --- a/test/MockHttp.Tests/Extensions/HttpContentExtensionsTests.cs +++ b/test/MockHttp.Tests/Extensions/HttpContentExtensionsTests.cs @@ -68,7 +68,7 @@ static object[] CreateTestCase(HttpContent content, string expectedData) yield return CreateTestCase(new StringContent(data), data); yield return CreateTestCase(new ByteArrayContent(buffer), data); yield return CreateTestCase(new StreamContent(new MemoryStream(buffer)), data); - yield return CreateTestCase(new FormUrlEncodedContent(new Dictionary { { "key", data } }), "key=" + Uri.EscapeDataString(data)); + yield return CreateTestCase(new FormUrlEncodedContent(new[] { new KeyValuePair("key", data) }), "key=" + Uri.EscapeDataString(data)); var mpc = new MultipartContent("subtype", "boundary") { new StringContent(data) }; yield return CreateTestCase(mpc, "--boundary\r\nContent-Type: text/plain; charset=utf-8\r\n\r\ndata\r\n--boundary--\r\n"); diff --git a/test/MockHttp.Tests/Extensions/RequestMatchingExtensionsTests.cs b/test/MockHttp.Tests/Extensions/RequestMatchingExtensionsTests.cs index 2f4c048b..e3a010c0 100644 --- a/test/MockHttp.Tests/Extensions/RequestMatchingExtensionsTests.cs +++ b/test/MockHttp.Tests/Extensions/RequestMatchingExtensionsTests.cs @@ -248,7 +248,7 @@ public async Task When_configuring_formData_with_null_value_should_match() RequestUri = new Uri("http://127.0.0.1"), Content = new FormUrlEncodedContent(new[] { - new KeyValuePair("key", null!) + new KeyValuePair("key", null!) }) }; @@ -269,7 +269,7 @@ public async Task When_configuring_formData_with_empty_value_should_match() RequestUri = new Uri("http://127.0.0.1"), Content = new FormUrlEncodedContent(new[] { - new KeyValuePair("key", string.Empty) + new KeyValuePair("key", string.Empty) }) };