title: How to compare two Json objects using C#
body: <p>I have two Json objects as below need to be compared. I am using Newtonsoft libraries for Json parsing.</p>
  
  <pre><code>string InstanceExpected = jsonExpected;
  string InstanceActual = jsonActual;
  var InstanceObjExpected = JObject.Parse(InstanceExpected);
  var InstanceObjActual = JObject.Parse(InstanceActual);
  </code></pre>
  
  <p>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.</p>
  
  <pre><code>InstanceObjActual.Should().BeEquivalentTo(InstanceObjExpected);
  </code></pre>
  
  <p>For example I have the actual and expected json to compare as below. And using the above way of comparing make them Pass which is wrong.</p>
  
  <pre><code>{
    "Name": "20181004164456",
    "objectId": "4ea9b00b-d601-44af-a990-3034af18fdb1%&gt;"  
  }
  
  {
    "Name": "AAAAAAAAAAAA",
    "objectId": "4ea9b00b-d601-44af-a990-3034af18fdb1%&gt;"  
  }
  </code></pre>