mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-01 14:43:04 +02:00
Add ThrowExceptionWhenMatcherFails option to all Matchers (#500)
* . * ut * IMatcher.ThrowException * settings * more tests * linq matcher throw * . * .
This commit is contained in:
@@ -29,6 +29,9 @@ namespace WireMock.Matchers
|
||||
|
||||
public MatchBehaviour MatchBehaviour { get; }
|
||||
|
||||
/// <inheritdoc cref="IMatcher.ThrowException"/>
|
||||
public bool ThrowException { get; }
|
||||
|
||||
private readonly string[] _patterns;
|
||||
|
||||
/// <summary>
|
||||
@@ -49,6 +52,7 @@ namespace WireMock.Matchers
|
||||
Check.NotNull(patterns, nameof(patterns));
|
||||
|
||||
MatchBehaviour = matchBehaviour;
|
||||
ThrowException = false;
|
||||
_patterns = patterns;
|
||||
}
|
||||
|
||||
@@ -156,7 +160,7 @@ namespace WireMock.Matchers
|
||||
#if NETSTANDARD2_0
|
||||
script = csscript.GenericExtensions.CreateObject(assembly, "*");
|
||||
#else
|
||||
script = CSScriptLib.ReflectionExtensions.CreateObject(assembly,"*");
|
||||
script = CSScriptLib.ReflectionExtensions.CreateObject(assembly, "*");
|
||||
#endif
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user