mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-15 23:07:41 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54235fb699 | ||
|
|
a43a8154b1 | ||
|
|
b6c0aeceea |
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,3 +1,6 @@
|
||||
# 1.0.4.19 (31 October 2018)
|
||||
- [#220](https://github.com/WireMock-Net/WireMock.Net/pull/220) - Update SimpleCommandLineParser to handle arguments with key and value contributed by [StefH](https://github.com/StefH)
|
||||
|
||||
# 1.0.4.18 (27 October 2018)
|
||||
- [#207](https://github.com/WireMock-Net/WireMock.Net/pull/207) - Rewrite some unit-integration-tests to unit-tests (#206) contributed by [StefH](https://github.com/StefH)
|
||||
- [#208](https://github.com/WireMock-Net/WireMock.Net/pull/208) - Refactor contributed by [StefH](https://github.com/StefH)
|
||||
@@ -150,8 +153,6 @@
|
||||
- [#113](https://github.com/WireMock-Net/WireMock.Net/issues/113) - Feature: Add BodyAsJsonIndented for response message
|
||||
- [#114](https://github.com/WireMock-Net/WireMock.Net/issues/114) - Feature: Add PathSegments in Transform
|
||||
|
||||
# 1.0.3.13 (24 March 2018)
|
||||
|
||||
# 1.0.3.12 (24 March 2018)
|
||||
- [#100](https://github.com/WireMock-Net/WireMock.Net/issues/100) - Issue: JsonPathMatcher - not working for rootless jsons?
|
||||
|
||||
@@ -170,10 +171,6 @@
|
||||
# 1.0.3.7 (09 March 2018)
|
||||
- [#104](https://github.com/WireMock-Net/WireMock.Net/issues/104) - Issue: PlatformNotSupportedException
|
||||
|
||||
# 1.0.3.6 (08 March 2018)
|
||||
|
||||
# 1.0.3.5 (08 March 2018)
|
||||
|
||||
# 1.0.3.4 (04 March 2018)
|
||||
- [#95](https://github.com/WireMock-Net/WireMock.Net/pull/95) - Unittest fix contributed by [StefH](https://github.com/StefH)
|
||||
- [#96](https://github.com/WireMock-Net/WireMock.Net/pull/96) - Replace log4net by custom logger (#94) contributed by [StefH](https://github.com/StefH)
|
||||
@@ -189,12 +186,12 @@
|
||||
- [#91](https://github.com/WireMock-Net/WireMock.Net/issues/91) - Bug: WireMock.Net is not matching application/json http requests using JSONPathMatcher
|
||||
|
||||
# 1.0.3.2 (14 February 2018)
|
||||
- [#89](https://github.com/WireMock-Net/WireMock.Net/pull/89) - Add log4net logging contributed by [StefH](https://github.com/StefH)
|
||||
- [#90](https://github.com/WireMock-Net/WireMock.Net/pull/90) - Concurrent issue (#88) contributed by [StefH](https://github.com/StefH)
|
||||
- [#87](https://github.com/WireMock-Net/WireMock.Net/issues/87) - Feature: Add logging
|
||||
- [#88](https://github.com/WireMock-Net/WireMock.Net/issues/88) - Bug: Standalone server throws 500 error when receiving concurrent requests
|
||||
|
||||
# 1.0.3.1 (14 February 2018)
|
||||
- [#89](https://github.com/WireMock-Net/WireMock.Net/pull/89) - Add log4net logging contributed by [StefH](https://github.com/StefH)
|
||||
- [#87](https://github.com/WireMock-Net/WireMock.Net/issues/87) - Feature: Add logging
|
||||
|
||||
# 1.0.3.0 (05 February 2018)
|
||||
- [#80](https://github.com/WireMock-Net/WireMock.Net/issues/80) - Feature: When using proxy, in case Content-Type is JSON, use BodyAsJson in Response
|
||||
@@ -285,10 +282,6 @@
|
||||
- [#23](https://github.com/WireMock-Net/WireMock.Net/issues/23) - Consider port to .Net Core
|
||||
- [#25](https://github.com/WireMock-Net/WireMock.Net/issues/25) - Upgrade to vs2017
|
||||
|
||||
# 1.0.1.5 (21 March 2017)
|
||||
|
||||
# 1.0.1.3 (20 March 2017)
|
||||
|
||||
# 1.0.1.2 (27 February 2017)
|
||||
- [#24](https://github.com/WireMock-Net/WireMock.Net/pull/24) - Body Encoding contributed by [sbebrys](https://github.com/sbebrys)
|
||||
- [#8](https://github.com/WireMock-Net/WireMock.Net/issues/8) - admin rest api
|
||||
@@ -312,5 +305,3 @@
|
||||
- [#17](https://github.com/WireMock-Net/WireMock.Net/issues/17) - Add JsonBody to response
|
||||
- [#18](https://github.com/WireMock-Net/WireMock.Net/issues/18) - Listen on more ip-address/ports
|
||||
|
||||
# 1.0.0.0 (17 January 2017)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionPrefix>1.0.4.18</VersionPrefix>
|
||||
<VersionPrefix>1.0.4.19</VersionPrefix>
|
||||
</PropertyGroup>
|
||||
|
||||
<Choose>
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,3 @@
|
||||
https://github.com/StefH/GitHubReleaseNotes
|
||||
|
||||
GitHubReleaseNotes.exe . --output CHANGELOG.md
|
||||
GitHubReleaseNotes.exe . --output CHANGELOG.md --skip-empty-releases --version 1.0.4.19
|
||||
@@ -24,6 +24,7 @@ A C# .NET version based on [mock4net](https://github.com/alexvictoor/mock4net) w
|
||||
| **Sonar Bugs** | [](https://sonarcloud.io/project/issues?id=wiremock&resolved=false&types=BUG) |
|
||||
| **Sonar Code Smells** | [](https://sonarcloud.io/project/issues?id=wiremock&resolved=false&types=CODE_SMELL) |
|
||||
| **Sonar Coverage** | [](https://sonarcloud.io/component_measures?id=wiremock&metric=coverage) |
|
||||
| **Codecov** | [](https://codecov.io/gh/WireMock-Net/WireMock.Net) |
|
||||
| **Coveralls** | [](https://coveralls.io/github/WireMock-Net/WireMock.Net?branch=master) |
|
||||
| |
|
||||
| ***NuGet*** | |
|
||||
|
||||
@@ -8,28 +8,20 @@ namespace WireMock.Net.StandAlone
|
||||
internal class SimpleCommandLineParser
|
||||
{
|
||||
private const string Sigil = "--";
|
||||
private const string SigilAzureServiceFabric = "'--";
|
||||
|
||||
private enum SigilType
|
||||
{
|
||||
Normal,
|
||||
AzureServiceFabric
|
||||
}
|
||||
|
||||
private IDictionary<string, string[]> Arguments { get; } = new Dictionary<string, string[]>();
|
||||
|
||||
public void Parse(string[] args)
|
||||
public void Parse(string[] arguments)
|
||||
{
|
||||
SigilType sigil = SigilType.Normal;
|
||||
string currentName = null;
|
||||
|
||||
var values = new List<string>();
|
||||
foreach (string arg in args)
|
||||
|
||||
// Split a single argument on a space character to fix issue (e.g. Azure Service Fabric) when an argument is supplied like "--x abc" or '--x abc'
|
||||
foreach (string arg in arguments.SelectMany(arg => arg.Split(' ')))
|
||||
{
|
||||
if (arg.StartsWith(Sigil))
|
||||
{
|
||||
sigil = SigilType.Normal;
|
||||
|
||||
if (!string.IsNullOrEmpty(currentName))
|
||||
{
|
||||
Arguments[currentName] = values.ToArray();
|
||||
@@ -38,33 +30,13 @@ namespace WireMock.Net.StandAlone
|
||||
values.Clear();
|
||||
currentName = arg.Substring(Sigil.Length);
|
||||
}
|
||||
// Azure Service Fabric passes the command line parameter surrounded with single quotes. (https://github.com/Microsoft/service-fabric/issues/234)
|
||||
else if (arg.StartsWith(SigilAzureServiceFabric))
|
||||
{
|
||||
sigil = SigilType.AzureServiceFabric;
|
||||
|
||||
if (!string.IsNullOrEmpty(currentName))
|
||||
{
|
||||
Arguments[currentName] = values.ToArray();
|
||||
}
|
||||
|
||||
values.Clear();
|
||||
currentName = arg.Substring(SigilAzureServiceFabric.Length);
|
||||
}
|
||||
else if (string.IsNullOrEmpty(currentName))
|
||||
{
|
||||
Arguments[arg] = new string[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sigil == SigilType.Normal)
|
||||
{
|
||||
values.Add(arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
values.Add(arg.Substring(0, arg.Length - 1));
|
||||
}
|
||||
values.Add(arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ namespace WireMock.Net.Tests.StandAlone
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SimpleCommandLineParser_Parse_ArgumentsWithSingleQuotes()
|
||||
public void SimpleCommandLineParser_Parse_ArgumentsAsCombinedKeyAndValue()
|
||||
{
|
||||
// Assign
|
||||
_parser.Parse(new[] { "'--test1", "one'", "'--test2", "two'", "'--test3", "three'" });
|
||||
_parser.Parse(new[] { "--test1 one", "--test2 two", "--test3 three" });
|
||||
|
||||
// Act
|
||||
string value1 = _parser.GetStringValue("test1");
|
||||
@@ -51,7 +51,7 @@ namespace WireMock.Net.Tests.StandAlone
|
||||
public void SimpleCommandLineParser_Parse_ArgumentsMixed()
|
||||
{
|
||||
// Assign
|
||||
_parser.Parse(new[] { "'--test1", "one'", "--test2", "two", "--test3", "three" });
|
||||
_parser.Parse(new[] { "--test1 one", "--test2", "two", "--test3 three" });
|
||||
|
||||
// Act
|
||||
string value1 = _parser.GetStringValue("test1");
|
||||
@@ -68,7 +68,7 @@ namespace WireMock.Net.Tests.StandAlone
|
||||
public void SimpleCommandLineParser_Parse_GetBoolValue()
|
||||
{
|
||||
// Assign
|
||||
_parser.Parse(new[] { "'--test1", "false'", "--test2", "true" });
|
||||
_parser.Parse(new[] { "'--test1", "false'", "--test2 true" });
|
||||
|
||||
// Act
|
||||
bool value1 = _parser.GetBoolValue("test1");
|
||||
@@ -85,7 +85,7 @@ namespace WireMock.Net.Tests.StandAlone
|
||||
public void SimpleCommandLineParser_Parse_GetIntValue()
|
||||
{
|
||||
// Assign
|
||||
_parser.Parse(new[] { "'--test1", "42'", "--test2", "55" });
|
||||
_parser.Parse(new[] { "--test1", "42", "--test2 55" });
|
||||
|
||||
// Act
|
||||
int? value1 = _parser.GetIntValue("test1");
|
||||
|
||||
Reference in New Issue
Block a user