mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-25 10:19:04 +02:00
Write logging in case a Matcher throws an exception (#986)
* ThrowException * ... * . * ... * b * fix test * ... * . * sonar * ft * . * fix tst
This commit is contained in:
@@ -53,7 +53,7 @@ public class RegexMatcherTests
|
||||
var matcher = new RegexMatcher("H.*o");
|
||||
|
||||
// Act
|
||||
double result = matcher.IsMatch("Hello world!");
|
||||
double result = matcher.IsMatch("Hello world!").Score;
|
||||
|
||||
// Assert
|
||||
Check.That(result).IsEqualTo(1.0d);
|
||||
@@ -66,7 +66,7 @@ public class RegexMatcherTests
|
||||
var matcher = new RegexMatcher("H.*o");
|
||||
|
||||
// Act
|
||||
double result = matcher.IsMatch(null);
|
||||
double result = matcher.IsMatch(null).Score;
|
||||
|
||||
// Assert
|
||||
Check.That(result).IsEqualTo(0.0d);
|
||||
@@ -79,7 +79,7 @@ public class RegexMatcherTests
|
||||
var matcher = new RegexMatcher(@"\GUIDB", true);
|
||||
|
||||
// Act
|
||||
double result = matcher.IsMatch(Guid.NewGuid().ToString("B"));
|
||||
double result = matcher.IsMatch(Guid.NewGuid().ToString("B")).Score;
|
||||
|
||||
// Assert
|
||||
result.Should().Be(1.0);
|
||||
@@ -89,10 +89,10 @@ public class RegexMatcherTests
|
||||
public void RegexMatcher_IsMatch_Regex_Guid()
|
||||
{
|
||||
// Assign
|
||||
var matcher = new RegexMatcher(@"\GUIDB", true, false, false);
|
||||
var matcher = new RegexMatcher(@"\GUIDB", true, false);
|
||||
|
||||
// Act
|
||||
double result = matcher.IsMatch(Guid.NewGuid().ToString("B"));
|
||||
double result = matcher.IsMatch(Guid.NewGuid().ToString("B")).Score;
|
||||
|
||||
// Assert
|
||||
result.Should().Be(0);
|
||||
@@ -105,7 +105,7 @@ public class RegexMatcherTests
|
||||
var matcher = new RegexMatcher("H.*o", true);
|
||||
|
||||
// Act
|
||||
double result = matcher.IsMatch("hello");
|
||||
double result = matcher.IsMatch("hello").Score;
|
||||
|
||||
// Assert
|
||||
Check.That(result).IsEqualTo(1.0d);
|
||||
@@ -118,7 +118,7 @@ public class RegexMatcherTests
|
||||
var matcher = new RegexMatcher(MatchBehaviour.RejectOnMatch, "h.*o");
|
||||
|
||||
// Act
|
||||
double result = matcher.IsMatch("hello");
|
||||
double result = matcher.IsMatch("hello").Score;
|
||||
|
||||
// Assert
|
||||
Check.That(result).IsEqualTo(0.0);
|
||||
|
||||
Reference in New Issue
Block a user