mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-11-17 06:11:06 +01:00
Fix JsonMatcher (parsing DateTimeOffset) (#358)
* . * JObject Parse * JsonUtils.Parse * fix code comments
This commit is contained in:
1 parent
b2167f85ae
commit
7789f94737
4 files changed
+45
-9
No files matched your search
@@ -192,5 +192,22 @@ namespace WireMock.Net.Tests.Matchers
|
||||
// Assert
|
||||
Assert.Equal(0.0, match);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JsonMatcher_IsMatch_JObjectWithDateTimeOffsetAsString()
|
||||
{
|
||||
// Assign
|
||||
var matcher = new JsonMatcher("{ \"preferredAt\" : \"2019-11-21T10:32:53.2210009+00:00\" }");
|
||||
|
||||
// Act
|
||||
var jobject = new JObject
|
||||
{
|
||||
{ "preferredAt", new JValue("2019-11-21T10:32:53.2210009+00:00") }
|
||||
};
|
||||
double match = matcher.IsMatch(jobject);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(1.0, match);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user