mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-08-25 13:14:15 +02:00
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Copilot Autofix powered by AI
parent
48792c7b7b
commit
0809c1888f
@@ -355,8 +355,9 @@ public partial class WireMockServerTests
|
||||
);
|
||||
|
||||
// Act
|
||||
var content = new FormUrlEncodedContent([new KeyValuePair<string, string>("key1", "value1")]);
|
||||
var response = await new HttpClient()
|
||||
using var content = new FormUrlEncodedContent([new KeyValuePair<string, string>("key1", "value1")]);
|
||||
using var httpClient = new HttpClient();
|
||||
var response = await httpClient
|
||||
.PostAsync($"{server.Url}/foo", content, _ct);
|
||||
|
||||
// Assert
|
||||
@@ -374,15 +375,16 @@ public partial class WireMockServerTests
|
||||
Request.Create()
|
||||
.UsingPost()
|
||||
.WithPath("/foo")
|
||||
.WithBody((IDictionary<string, WireMockList<string>>? values) => values != null && values["key1"] == "value1")
|
||||
.WithBody((IDictionary<string, WireMockList<string>>? values) => values != null && values.TryGetValue("key1", out var v) && v == "value1")
|
||||
)
|
||||
.RespondWith(
|
||||
Response.Create()
|
||||
);
|
||||
|
||||
// Act
|
||||
var content = new FormUrlEncodedContent([new KeyValuePair<string, string>("key1", "value1")]);
|
||||
var response = await new HttpClient()
|
||||
using var content = new FormUrlEncodedContent([new KeyValuePair<string, string>("key1", "value1")]);
|
||||
using var httpClient = new HttpClient();
|
||||
var response = await httpClient
|
||||
.PostAsync($"{server.Url}/foo", content, _ct);
|
||||
|
||||
// Assert
|
||||
|
||||
Reference in New Issue
Block a user