mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-22 16:28:27 +02:00
@@ -4,7 +4,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VersionPrefix>1.0.22</VersionPrefix>
|
<VersionPrefix>1.0.23</VersionPrefix>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Choose>
|
<Choose>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
https://github.com/StefH/GitHubReleaseNotes
|
https://github.com/StefH/GitHubReleaseNotes
|
||||||
|
|
||||||
GitHubReleaseNotes.exe --output CHANGELOG.md --skip-empty-releases --version 1.0.22.0
|
GitHubReleaseNotes.exe --output CHANGELOG.md --skip-empty-releases --version 1.0.23.0
|
||||||
@@ -38,6 +38,9 @@ steps:
|
|||||||
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"
|
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"
|
||||||
displayName: End SonarScanner
|
displayName: End SonarScanner
|
||||||
|
|
||||||
|
- task: whitesource.ws-bolt.bolt.wss.WhiteSource Bolt@19
|
||||||
|
displayName: 'WhiteSource Bolt'
|
||||||
|
|
||||||
# Upload coverage to codecov.io
|
# Upload coverage to codecov.io
|
||||||
- script: |
|
- script: |
|
||||||
%USERPROFILE%\.nuget\packages\codecov\1.1.0\tools\codecov.exe -f "./test/WireMock.Net.Tests/coverage.opencover.xml" -t $(CODECOV_TOKEN)
|
%USERPROFILE%\.nuget\packages\codecov\1.1.0\tools\codecov.exe -f "./test/WireMock.Net.Tests/coverage.opencover.xml" -t $(CODECOV_TOKEN)
|
||||||
|
|||||||
@@ -448,6 +448,8 @@ namespace WireMock.Net.ConsoleApplication
|
|||||||
.WithHeader("Content-Type", "application/json")
|
.WithHeader("Content-Type", "application/json")
|
||||||
.WithBodyAsJson(new { Id = "5bdf076c-5654-4b3e-842c-7caf1fabf8c9" }));
|
.WithBodyAsJson(new { Id = "5bdf076c-5654-4b3e-842c-7caf1fabf8c9" }));
|
||||||
|
|
||||||
|
System.Console.WriteLine(JsonConvert.SerializeObject(server.MappingModels, Formatting.Indented));
|
||||||
|
|
||||||
System.Console.WriteLine("Press any key to stop the server");
|
System.Console.WriteLine("Press any key to stop the server");
|
||||||
System.Console.ReadKey();
|
System.Console.ReadKey();
|
||||||
server.Stop();
|
server.Stop();
|
||||||
|
|||||||
@@ -427,17 +427,14 @@ namespace WireMock.Server
|
|||||||
{
|
{
|
||||||
return Path.GetInvalidFileNameChars().Aggregate(name, (current, c) => current.Replace(c, replaceChar));
|
return Path.GetInvalidFileNameChars().Aggregate(name, (current, c) => current.Replace(c, replaceChar));
|
||||||
}
|
}
|
||||||
|
private IEnumerable<MappingModel> ToMappingModels()
|
||||||
|
{
|
||||||
|
return Mappings.Where(m => !m.IsAdminInterface).Select(MappingConverter.ToMappingModel);
|
||||||
|
}
|
||||||
|
|
||||||
private ResponseMessage MappingsGet(RequestMessage requestMessage)
|
private ResponseMessage MappingsGet(RequestMessage requestMessage)
|
||||||
{
|
{
|
||||||
var result = new List<MappingModel>();
|
return ToJson(ToMappingModels());
|
||||||
foreach (var mapping in Mappings.Where(m => !m.IsAdminInterface))
|
|
||||||
{
|
|
||||||
var model = MappingConverter.ToMappingModel(mapping);
|
|
||||||
result.Add(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ToJson(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ResponseMessage MappingsPost(RequestMessage requestMessage)
|
private ResponseMessage MappingsPost(RequestMessage requestMessage)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using WireMock.Admin.Mappings;
|
||||||
using WireMock.Exceptions;
|
using WireMock.Exceptions;
|
||||||
using WireMock.Handlers;
|
using WireMock.Handlers;
|
||||||
using WireMock.Logging;
|
using WireMock.Logging;
|
||||||
@@ -55,6 +56,12 @@ namespace WireMock.Server
|
|||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public IEnumerable<IMapping> Mappings => _options.Mappings.Values.ToArray();
|
public IEnumerable<IMapping> Mappings => _options.Mappings.Values.ToArray();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the mappings as MappingModels.
|
||||||
|
/// </summary>
|
||||||
|
[PublicAPI]
|
||||||
|
public IEnumerable<MappingModel> MappingModels => ToMappingModels();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the scenarios.
|
/// Gets the scenarios.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -47,12 +47,14 @@ namespace WireMock.Net.Tests
|
|||||||
server.ReadStaticMappings(folder);
|
server.ReadStaticMappings(folder);
|
||||||
|
|
||||||
Check.That(server.Mappings).HasSize(5);
|
Check.That(server.Mappings).HasSize(5);
|
||||||
|
Check.That(server.MappingModels).HasSize(5);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
server.ResetMappings();
|
server.ResetMappings();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Check.That(server.Mappings).HasSize(0);
|
Check.That(server.Mappings).HasSize(0);
|
||||||
|
Check.That(server.MappingModels).HasSize(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
Reference in New Issue
Block a user