-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve possibility to exclude certain fields from comparaison #21
Labels
Comments
dstj
changed the title
Add the possibility to exclude certain fields from comparaison
Improve possibility to exclude certain fields from comparaison
Jun 7, 2018
Yeah, JSON support is pretty limited right now and we do not get a lot of feature request for this part of FA. |
Is there any plan to implement something like this in the near future? I could really use it |
No, not really. The JSON implementation was a contribution by somebody else. I myself am not using it very often. But we would welcome PRs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm using
FluentAssertions.Json
in a functional test to validate the response from an access token creation endpoint. Obviously, the returnedaccess_token
JSON property varies from test to test, but I'd like to to useFluentAssertions.Json
to compare everything else. I'd like to do something like:or this signature may be more versatile:
Right now, I have to do remove the
access_token
property from the response before comparing the other fields:Another idea, but more complex to implement I believe, would be to allow specifying a regex comparer for certain fields.
Update
After looking at the source code, I tried with:
This works but in case of error, it's impossible to understand what is wrong with the actual JSON as the message simply is:
The text was updated successfully, but these errors were encountered: