You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation is sparse (Is this NewtonSoft only?) #70
Now reading the short Readme I have more questions:
The lib is named FluentAssertions.Json, however the description says these are "NewtonSoft.Json extensions for FluentAssertions". So, especially given C# now has it's own internal JSON (de)serializer, is this library
for me, if I develop something with NewtonSoft? or
is it for me, if I have some JSON and want to compare it.
If the first case is true, and this is only usable with NewtonSoft, then why is not it named FluentAssertions.NewtonSoft?
The examples using JToken, which seems obligatory (is it?), also seem to make me tend guess it is more about case 1, i.e. a NewtonSoft-only extension.
IMHO, for beginners, this documentation here should be improved or maybe the name should be adjusted, to clarify this.
Thanks for your message. And you're right. The library fulfills a niche and only works with NewtonSoft.Json because that was the only JSON library that existed at the time this repo was created.
Activity
dennisdoomen commentedon Jan 13, 2023
Thanks for your message. And you're right. The library fulfills a niche and only works with NewtonSoft.Json because that was the only JSON library that existed at the time this repo was created.
To solve your original question on how to use FA to deserialize JSON, you might want to check out https://github.com/dennisdoomen/EffectiveTddDemo/blob/master/Tests/DocumentManagement.Specs/13_SimplerDeserialization/StatisticsControllerSpecs.cs#L77. It uses a custom version of
BeEquivalentTothat might be doing exactly what you had in mind...