mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-01 06:33:11 +02:00
Rewrite some unit-integration-tests to unit-tests (#206)
This commit is contained in:
@@ -256,7 +256,7 @@ namespace WireMock.Server
|
||||
return responseMessage;
|
||||
}
|
||||
|
||||
private Mapping ToMapping(RequestMessage requestMessage, ResponseMessage responseMessage, string[] blacklistedHeaders)
|
||||
private IMapping ToMapping(RequestMessage requestMessage, ResponseMessage responseMessage, string[] blacklistedHeaders)
|
||||
{
|
||||
var request = Request.Create();
|
||||
request.WithPath(requestMessage.Path);
|
||||
@@ -371,7 +371,7 @@ namespace WireMock.Server
|
||||
return ResponseMessageBuilder.Create("Mappings saved to disk");
|
||||
}
|
||||
|
||||
private void SaveMappingToFile(Mapping mapping, string folder = null)
|
||||
private void SaveMappingToFile(IMapping mapping, string folder = null)
|
||||
{
|
||||
if (folder == null)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace WireMock.Server
|
||||
|
||||
private const int ServerStartDelay = 100;
|
||||
private readonly IOwinSelfHost _httpServer;
|
||||
private readonly WireMockMiddlewareOptions _options = new WireMockMiddlewareOptions();
|
||||
private readonly IWireMockMiddlewareOptions _options = new WireMockMiddlewareOptions();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this server is started.
|
||||
@@ -53,7 +53,7 @@ namespace WireMock.Server
|
||||
/// Gets the mappings.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public IEnumerable<Mapping> Mappings => _options.Mappings.Values.ToArray();
|
||||
public IEnumerable<IMapping> Mappings => _options.Mappings.Values.ToArray();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scenarios.
|
||||
@@ -265,6 +265,11 @@ namespace WireMock.Server
|
||||
InitProxyAndRecord(settings);
|
||||
}
|
||||
|
||||
if (settings.RequestLogExpirationDuration != null)
|
||||
{
|
||||
SetRequestLogExpirationDuration(settings.RequestLogExpirationDuration);
|
||||
}
|
||||
|
||||
if (settings.MaxRequestLogCount != null)
|
||||
{
|
||||
SetMaxRequestLogCount(settings.MaxRequestLogCount);
|
||||
@@ -424,7 +429,7 @@ namespace WireMock.Server
|
||||
return new RespondWithAProvider(RegisterMapping, requestMatcher);
|
||||
}
|
||||
|
||||
private void RegisterMapping(Mapping mapping)
|
||||
private void RegisterMapping(IMapping mapping)
|
||||
{
|
||||
// Check a mapping exists with the same Guid, if so, replace it.
|
||||
if (_options.Mappings.ContainsKey(mapping.Guid))
|
||||
|
||||
Reference in New Issue
Block a user