views:

31

answers:

2

Hi

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...

+2  A: 

Try

Assert.AreElementsEqualIgnoringOrder(expectedOutputFieldList, actualOutputFieldList);
Mauricio Scheffer
+1  A: 

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