UrlModel + Funcs

This commit is contained in:
Stef Heyenrath
2017-02-03 13:54:19 +01:00
parent 84901ab1e4
commit d1aa517f99
17 changed files with 173 additions and 58 deletions

View File

@@ -19,7 +19,7 @@ namespace WireMock.Matchers.Request
/// <summary>
/// The path functions
/// </summary>
private readonly Func<string, bool>[] _pathFuncs;
public Func<string, bool>[] Funcs { get; }
/// <summary>
/// Initializes a new instance of the <see cref="RequestMessagePathMatcher"/> class.
@@ -46,7 +46,7 @@ namespace WireMock.Matchers.Request
public RequestMessagePathMatcher([NotNull] params Func<string, bool>[] funcs)
{
Check.NotNull(funcs, nameof(funcs));
_pathFuncs = funcs;
Funcs = funcs;
}
/// <summary>
@@ -61,8 +61,8 @@ namespace WireMock.Matchers.Request
if (Matchers != null)
return Matchers.Any(matcher => matcher.IsMatch(requestMessage.Path));
if (_pathFuncs != null)
return _pathFuncs.Any(func => func(requestMessage.Path));
if (Funcs != null)
return Funcs.Any(func => func(requestMessage.Path));
return false;
}