Closed egil closed 1 year ago
This looks reasonable, structural matching is something that's outside of Alba's own toolkit. ReadBody
is in the samples so it being internal is likely an oversight, I'll expose it in the next release.
Cool. The alternative would be to lazily use it to set the Body
property on the ScenarioAssertionException
that is being passed to the assertion method. That would be my preference.
Hi there,
First off, great library!
For a project, I needed a way to verify that the structure of the raw JSON returned from a request matches our API contract, so I created the following custom extension method.
However, I had to copy in the
ReadBody
method since it was internal, which leads me to believe it should either be public, or I am doing something wrong.Here is my custom assertion helper, which uses the https://github.com/weichch/system-text-json-jsondiffpatch library to perform the JSON comparison:
Does this look OK or should I be doing something differently here?