mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-15 08:03:31 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af46a490a5 |
@@ -4,7 +4,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionPrefix>1.0.22</VersionPrefix>
|
||||
<VersionPrefix>1.0.23</VersionPrefix>
|
||||
</PropertyGroup>
|
||||
|
||||
<Choose>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
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)"
|
||||
displayName: End SonarScanner
|
||||
|
||||
- task: whitesource.ws-bolt.bolt.wss.WhiteSource Bolt@19
|
||||
displayName: 'WhiteSource Bolt'
|
||||
|
||||
# Upload coverage to codecov.io
|
||||
- script: |
|
||||
%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")
|
||||
.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.ReadKey();
|
||||
server.Stop();
|
||||
|
||||
@@ -427,17 +427,14 @@ namespace WireMock.Server
|
||||
{
|
||||
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)
|
||||
{
|
||||
var result = new List<MappingModel>();
|
||||
foreach (var mapping in Mappings.Where(m => !m.IsAdminInterface))
|
||||
{
|
||||
var model = MappingConverter.ToMappingModel(mapping);
|
||||
result.Add(model);
|
||||
}
|
||||
|
||||
return ToJson(result);
|
||||
return ToJson(ToMappingModels());
|
||||
}
|
||||
|
||||
private ResponseMessage MappingsPost(RequestMessage requestMessage)
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using WireMock.Admin.Mappings;
|
||||
using WireMock.Exceptions;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Logging;
|
||||
@@ -55,6 +56,12 @@ namespace WireMock.Server
|
||||
[PublicAPI]
|
||||
public IEnumerable<IMapping> Mappings => _options.Mappings.Values.ToArray();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the mappings as MappingModels.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public IEnumerable<MappingModel> MappingModels => ToMappingModels();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scenarios.
|
||||
/// </summary>
|
||||
|
||||
@@ -47,12 +47,14 @@ namespace WireMock.Net.Tests
|
||||
server.ReadStaticMappings(folder);
|
||||
|
||||
Check.That(server.Mappings).HasSize(5);
|
||||
Check.That(server.MappingModels).HasSize(5);
|
||||
|
||||
// Act
|
||||
server.ResetMappings();
|
||||
|
||||
// Assert
|
||||
Check.That(server.Mappings).HasSize(0);
|
||||
Check.That(server.MappingModels).HasSize(0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user