Add extra unit tests for PR #1278

This commit is contained in:
Stef Heyenrath
2025-04-23 07:47:07 +02:00
parent d9a7e80360
commit beabba4064
2 changed files with 28 additions and 4 deletions

View File

@@ -55,11 +55,23 @@ public class JmesPathMatcherTests
public void JmesPathMatcher_IsMatch_NullString()
{
// Assign
string? s = null;
var matcher = new JmesPathMatcher("");
// Act
double match = matcher.IsMatch(s).Score;
double match = matcher.IsMatch(null).Score;
// Assert
Check.That(match).IsEqualTo(0);
}
[Fact]
public void JmesPathMatcher_IsMatch_EmptyString()
{
// Assign
var matcher = new JmesPathMatcher("");
// Act
double match = matcher.IsMatch(string.Empty).Score;
// Assert
Check.That(match).IsEqualTo(0);

View File

@@ -55,11 +55,23 @@ public class JsonPathMatcherTests
public void JsonPathMatcher_IsMatch_NullString()
{
// Arrange
string? s = null;
var matcher = new JsonPathMatcher("");
// Act
double match = matcher.IsMatch(s).Score;
double match = matcher.IsMatch(null).Score;
// Assert
Check.That(match).IsEqualTo(0);
}
[Fact]
public void JsonPathMatcher_IsMatch_EmptyString()
{
// Arrange
var matcher = new JsonPathMatcher("");
// Act
double match = matcher.IsMatch(string.Empty).Score;
// Assert
Check.That(match).IsEqualTo(0);