diff --git a/test/WireMock.Net.Tests/Matchers/JsonPartialMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/JsonPartialMatcherTests.cs index cac8be775..3a2d30439 100644 --- a/test/WireMock.Net.Tests/Matchers/JsonPartialMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/JsonPartialMatcherTests.cs @@ -199,6 +199,27 @@ public void JsonPartialMatcher_IsMatch_WithRegexFalse() Assert.Equal(0.0, match); } + [Fact] + public void JsonPartialMatcher_IsMatch_GuidAsString_UsingRegex() + { + var guid = new Guid("1111238e-b775-44a9-a263-95e570135c94"); + var matcher = new JsonPartialMatcher(new { + Id = 1, + Name = "^1111[a-fA-F0-9]{4}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$" + }, false, false, true); + + // Act + var jObject = new JObject + { + { "Id", new JValue(1) }, + { "Name", new JValue(guid) } + }; + double match = matcher.IsMatch(jObject); + + // Assert + Assert.Equal(1.0, match); + } + [Fact] public void JsonPartialMatcher_IsMatch_WithIgnoreCaseTrue_JObject() {