Rewrite some unit-integration-tests to unit-tests (#206 #207)

Rewrite some unit-integration-tests to unit-tests (#206)
This commit is contained in:
Stef Heyenrath
2018-09-26 17:43:26 +02:00
committed by GitHub
parent 713e59bbf9
commit ada50d893f
134 changed files with 9159 additions and 8434 deletions

View File

@@ -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))