How to compare two Json objects using C#
I have two Json objects as below need to be compared. I am using Newtonsoft libraries for Json parsing. string InstanceExpected = jsonExpected; string InstanceActual = jsonActual; var InstanceObjExpected = JObject.Parse(InstanceExpected); var InstanceObjActual = JObject.Parse(InstanceActual); And I am using Fluent Assertions to compare it. But the problem is Fluent assertion fails only when the attribute count/names are not matching. If the json values are different it passes. I require to fail when values are different. InstanceObjActual.Should().BeEquivalentTo(InstanceObjExpected); For