-
-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AdminPath to WireMockServerSettings (#1130)
* Make admin endpoint configurable * Add AdminPath to WireMockServerSettings * sealed * foo * WireMockServer_CreateClient_And_CallAdminSettingsEndpoint
- Loading branch information
Showing
7 changed files
with
183 additions
and
83 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
test/WireMock.Net.Tests/Settings/WireMockServerSettingsParserTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using FluentAssertions; | ||
using WireMock.Settings; | ||
using Xunit; | ||
|
||
namespace WireMock.Net.Tests.Settings; | ||
|
||
public class WireMockServerSettingsParserTests | ||
{ | ||
[Fact] | ||
public void TryParseArguments_With_Args() | ||
{ | ||
// Act | ||
var result = WireMockServerSettingsParser.TryParseArguments(new[] | ||
{ | ||
"--adminPath", "ap" | ||
}, null, out var settings); | ||
|
||
// Assert | ||
result.Should().BeTrue(); | ||
settings.Should().NotBeNull(); | ||
settings!.AdminPath.Should().Be("ap"); | ||
} | ||
|
||
[Fact] | ||
public void TryParseArguments_Without_Args() | ||
{ | ||
// Act | ||
var result = WireMockServerSettingsParser.TryParseArguments(new string[] { }, null, out var settings); | ||
|
||
// Assert | ||
result.Should().BeTrue(); | ||
settings.Should().NotBeNull(); | ||
settings!.AdminPath.Should().Be("/__admin"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters