I ran into a bug in some code that extracts metadata from some text and puts it into a dictionary.
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.
I'd like to have an assert method available like :
Assert.AreEquivalent(propsExpected,propsActual)
That would evaluate like:
Assert.AreEqual(propsExpected.Count, propsActual.Count);
foreach (var key in propsExpected.Keys)
{
Assert.IsNotNull(props[key]);
Assert.AreEqual(propsExpected[key], props[key]);
}
What's the best way to do this?