Write logging in case a Matcher throws an exception (#986)

* ThrowException

* ...

* .

* ...

* b

* fix test

* ...

* .

* sonar

* ft

* .

* fix tst
This commit is contained in:
Stef Heyenrath
2023-08-21 20:07:46 +02:00
committed by GitHub
parent 09a302baf2
commit 93c87845c2
88 changed files with 1266 additions and 1244 deletions

View File

@@ -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);