mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-19 00:27:04 +01:00
Fixed #106
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Description>Lightweight StandAlone Http Mocking Server for .Net.</Description>
|
||||
<AssemblyTitle>WireMock.Net.StandAlone</AssemblyTitle>
|
||||
<Version>1.0.3.7</Version>
|
||||
<Version>1.0.3.8</Version>
|
||||
<Authors>Stef Heyenrath</Authors>
|
||||
<TargetFrameworks>net452;net46;netstandard1.3;netstandard2.0</TargetFrameworks>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
@@ -65,9 +65,15 @@ namespace WireMock.Matchers.Request
|
||||
return MatchScores.ToScore(requestMessage.Query != null && Funcs.Any(f => f(requestMessage.Query)));
|
||||
}
|
||||
|
||||
List<string> values = requestMessage.GetParameter(Key);
|
||||
var values = requestMessage.GetParameter(Key);
|
||||
if (values == null && !Values.Any())
|
||||
{
|
||||
// Key is present, but no values, just return match
|
||||
return MatchScores.Perfect;
|
||||
}
|
||||
|
||||
return MatchScores.ToScore(values?.Intersect(Values).Count() == Values.Count());
|
||||
var matches = Values.Select(v => values != null && values.Contains(v));
|
||||
return MatchScores.ToScore(matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,10 +180,11 @@ namespace WireMock
|
||||
queryString = queryString.Substring(1);
|
||||
}
|
||||
|
||||
return queryString.Split('&').Aggregate(new Dictionary<string, WireMockList<string>>(),
|
||||
return queryString.Split(new[] { '&' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Aggregate(new Dictionary<string, WireMockList<string>>(),
|
||||
(dict, term) =>
|
||||
{
|
||||
var parts = term.Split('=');
|
||||
string[] parts = term.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
string key = parts[0];
|
||||
if (!dict.ContainsKey(key))
|
||||
{
|
||||
@@ -192,7 +193,8 @@ namespace WireMock
|
||||
|
||||
if (parts.Length == 2)
|
||||
{
|
||||
dict[key].Add(parts[1]);
|
||||
string[] values = parts[1].Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
|
||||
dict[key].AddRange(values);
|
||||
}
|
||||
|
||||
return dict;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Description>Lightweight Http Mocking Server for .Net, inspired by WireMock from the Java landscape.</Description>
|
||||
<AssemblyTitle>WireMock.Net</AssemblyTitle>
|
||||
<Version>1.0.3.7</Version>
|
||||
<Version>1.0.3.8</Version>
|
||||
<Authors>Alexandre Victoor;Stef Heyenrath</Authors>
|
||||
<TargetFrameworks>net452;net46;netstandard1.3;netstandard2.0</TargetFrameworks>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
Reference in New Issue
Block a user