Fix Sonarqube issues

This commit is contained in:
Stef Heyenrath
2020-08-13 14:14:04 +02:00
parent 9665729e58
commit 7abf56eafa
15 changed files with 63 additions and 93 deletions

View File

@@ -833,9 +833,9 @@ namespace WireMock.Server
if (requestModel.Params != null)
{
foreach (var paramModel in requestModel.Params.Where(c => c.Matchers != null))
foreach (var paramModel in requestModel.Params.Where(p => p != null && p.Matchers != null))
{
bool ignoreCase = paramModel?.IgnoreCase ?? false;
bool ignoreCase = paramModel.IgnoreCase == true;
requestBuilder = requestBuilder.WithParam(paramModel.Name, ignoreCase, paramModel.Matchers.Select(_matcherMapper.Map).OfType<IStringMatcher>().ToArray());
}
}

View File

@@ -184,6 +184,17 @@ namespace WireMock.Server
ReadStaticMappings = true
});
}
/// <summary>
/// Initializes a new instance of the <see cref="WireMockServer"/> class.
/// </summary>
/// <param name="settings">The settings.</param>
/// <exception cref="WireMockException">
/// Service start failed with error: {_httpServer.RunningException.Message}
/// or
/// Service start failed with error: {startTask.Exception.Message}
/// </exception>
/// <exception cref="TimeoutException">Service start timed out after {TimeSpan.FromMilliseconds(settings.StartTimeout)}</exception>
protected WireMockServer(IWireMockServerSettings settings)
{
_settings = settings;
@@ -422,7 +433,7 @@ namespace WireMock.Server
{
_options.Scenarios.Clear();
}
/// <inheritdoc cref="IWireMockServer.WithMapping(MappingModel[])" />
[PublicAPI]
public IWireMockServer WithMapping(params MappingModel[] mappings)