mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-27 11:31:03 +01:00
Refactor MappingConverter & MatcherMapper (#323)
This commit is contained in:
@@ -5,17 +5,27 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WireMock.Admin.Mappings;
|
||||
using WireMock.Matchers;
|
||||
using WireMock.Settings;
|
||||
using WireMock.Validation;
|
||||
|
||||
namespace WireMock.Serialization
|
||||
{
|
||||
internal static class MatcherMapper
|
||||
internal class MatcherMapper
|
||||
{
|
||||
public static IMatcher[] Map([CanBeNull] IEnumerable<MatcherModel> matchers)
|
||||
private readonly IFluentMockServerSettings _settings;
|
||||
|
||||
public MatcherMapper(IFluentMockServerSettings settings)
|
||||
{
|
||||
Check.NotNull(settings, nameof(settings));
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
public IMatcher[] Map([CanBeNull] IEnumerable<MatcherModel> matchers)
|
||||
{
|
||||
return matchers?.Select(Map).Where(m => m != null).ToArray();
|
||||
}
|
||||
|
||||
public static IMatcher Map([CanBeNull] MatcherModel matcher)
|
||||
public IMatcher Map([CanBeNull] MatcherModel matcher)
|
||||
{
|
||||
if (matcher == null)
|
||||
{
|
||||
@@ -73,12 +83,12 @@ namespace WireMock.Serialization
|
||||
}
|
||||
}
|
||||
|
||||
public static MatcherModel[] Map([CanBeNull] IEnumerable<IMatcher> matchers)
|
||||
public MatcherModel[] Map([CanBeNull] IEnumerable<IMatcher> matchers)
|
||||
{
|
||||
return matchers?.Select(Map).Where(m => m != null).ToArray();
|
||||
}
|
||||
|
||||
public static MatcherModel Map([CanBeNull] IMatcher matcher)
|
||||
public MatcherModel Map([CanBeNull] IMatcher matcher)
|
||||
{
|
||||
if (matcher == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user