Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH committed Jul 27, 2024
1 parent 84ae2a5 commit 215e111
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/WireMock.Net/Matchers/FormUrlEncodedMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FormUrlEncodedMatcher : IStringMatcher, IIgnoreCaseMatcher
/// <inheritdoc />
public MatchBehaviour MatchBehaviour { get; }

private readonly IList<(string Key, string? Value)> _pairs;
private readonly List<(string Key, string? Value)> _pairs = new();

/// <summary>
/// Initializes a new instance of the <see cref="FormUrlEncodedMatcher"/> class.
Expand Down Expand Up @@ -85,7 +85,6 @@ public FormUrlEncodedMatcher(
MatchBehaviour = matchBehaviour;
MatchOperator = matchOperator;

_pairs = new List<(string, string?)>();
foreach (var pattern in _patterns)
{
if (QueryStringParser.TryParse(pattern, IgnoreCase, out var nameValueCollection))
Expand Down
2 changes: 1 addition & 1 deletion src/WireMock.Net/Serialization/MappingConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public string ToCSharpCode(IMapping mapping, MappingConverterSettings? settings

switch (firstMatcher)
{
case IStringMatcher stringMatcher when stringMatcher.GetPatterns().Any():
case IStringMatcher stringMatcher when stringMatcher.GetPatterns().Length > 0:
sb.AppendLine($" .WithBody({GetString(stringMatcher)})");
break;

Expand Down

0 comments on commit 215e111

Please sign in to comment.