title: How to build custom assertions in C#/VS?
body: <p>I ran into a bug in some code that extracts metadata from some text and puts it into a dictionary. </p>
  
  <p>My test was failing when I compared two dictionary objects because the keys were in different order. I don't really care what order the keys are in. </p>
  
  <p>I'd like to have an assert method available like :</p>
  
  <pre><code>Assert.AreEquivalent(propsExpected,propsActual)
  </code></pre>
  
  <p>That would evaluate like:</p>
  
  <pre><code>Assert.AreEqual(propsExpected.Count, propsActual.Count);
  foreach (var key in propsExpected.Keys)
  {
      Assert.IsNotNull(props[key]);
      Assert.AreEqual(propsExpected[key], props[key]);
  }
  </code></pre>
  
  <p>What's the best way to do this? </p>