Documentation is sparse (Is this NewtonSoft only?) #71
Replies: 2 comments
-
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 |
Beta Was this translation helpful? Give feedback.
-
If you are testing an API, this package might help https://github.com/adrianiftode/FluentAssertions.Web By default deserializes the response using System.Text.Json before comparing to the "object" with the JSON in the response. |
Beta Was this translation helpful? Give feedback.
-
In contrast to the main FluentAssertions library, the documentation is not a lot here.
I was coming here with the question: Can I use this to just de-serialize some JSON string and then just check whether that is "equivalent" to another object I want to compare it with, or, say, another string?
Now reading the short Readme I have more questions:
FluentAssertions.NewtonSoft
?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.
Beta Was this translation helpful? Give feedback.
All reactions