Closed BalassaMarton closed 6 years ago
Sorry, I missed this PR. Would you be willing to rebase on the release-5.0
hot-fix branch?
Hi, sure, as soon as I learn how to do that :)
I did a rebase althouth I'm not sure it worked. Can you look at it? I also commited the nuspec, please ignore it when merging.
Apparently you forgot to change the target branch to release 5.0. I didn't see that and accidentally merged this change. I'm currently merging 5.0 to master, so I'll ping you to re-apply the change later on
This constraint will match a JSON document against a subtree. This is useful when verifying JSON data, and multiple but not all properties of an object must be compared against known values. Example: I am testing some CRUD web service, have a response like this:
...and I want to assert that the request succeeded and the returned object has type
my-type
with nameFoo
. The other properties are irrelevant and/or unknown. Without this assertion, I'd have to write something like this:Yuck! The same test can be done with a single call using
ContainSubtree
:When using with arrays, the assertion is that the JSON array under testing must contain a matching element for each of the elements in the subtree array, eg. this should fail: