Search code examples
c#unit-testingdictionarymbunitgallio

Compare 2 lists in MbUnit 3.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...


Solution

  • Try

    Assert.AreElementsEqualIgnoringOrder(expectedOutputFieldList, actualOutputFieldList);