Semantic comparison of JSON with Verify #1059
Replies: 1 comment 9 replies
-
hey egil thanks for presenting Verify at Øredev. if u ever need help/review of content for a conference feel free to reach out. i am happy to workshop it with you re your extension method
That should be redundant. Verify will automatically await So your extension method usage
should be able to be changed to
unfortunately there is now way (at least that could discover) in xunit to derive the parameter values from within Verify. So that means you need to explicitly pass them in: https://github.com/VerifyTests/Verify/blob/main/docs/parameterised.md#xunit It is one of the reasons that i am gradually moving over to nunit. since it exposes parameter values though an API: https://github.com/VerifyTests/Verify/blob/main/docs/parameterised.md#nunit so while in this case i think your extension method if redundant, in the case where you do extend verify in that way, i would recommend always returning a |
Beta Was this translation helpful? Give feedback.
-
Hey all,
Recently did a session at the Øredev conference where I show how I like to test APIs. I use Verify for snapshot testing, and did make some changes to how it handles JSON. In particular, I leverage a semantic comparison library that understands JSON instead of using string based comparison.
Find the code here, and if anybody has any suggestions for improvements, please let me know: https://github.com/egil/ApiTestingAZ
@SimonCropp I do have a question: I created a custom extension method that which works as long the test doesn't have arguments. In that case, the same file is generated. What did I do wrong?
Beta Was this translation helpful? Give feedback.
All reactions