1

I am trying to compare 2 Dictionary objects for equality in MbUnit 3.1 like so

Assert.AreEqual<FieldList>(expectedOutputFieldList, actualOutputFieldList);

Where FieldList is = Dictionary<string, object>

However this throws up the following "error":

Both values look the same when formatted but they are distinct instances.

Is there any method for comparing object data rather than instances?

Thanks in advance...

Yann Trevin
  • 3,823
  • 1
  • 30
  • 32
Longball27
  • 676
  • 1
  • 8
  • 29

2 Answers2

2

Try

Assert.AreElementsEqualIgnoringOrder(expectedOutputFieldList, actualOutputFieldList);
Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
2

Mauricio is absolutely right. But more generally speaking, there are many useful assertions to be used with collections and enumerations in MbUnit v3. You may want to have a look at them:

Yann Trevin
  • 3,823
  • 1
  • 30
  • 32