I have
var xmlConfiguration = InitTestConfiguration();
var xmlConfiguration2 = InitTestConfiguration();
Assert.AreEqual(xmlConfiguration, xmlConfiguration2);
And I get this error:
Expected: <XmlConfiguration`1[Tests.TestConfiguration]>
But was: <XmlConfiguration`1[Tests.TestConfiguration]>
Where XmlConfiguration is a class containing a string and an integer.
What am I doing wrong?
The equals checks for same reference (while you are creating two different objects with same values – different reference) and by your example i guess you are trying to check for state equality…
you can create a class that wraps XmlConfiguration and implement (by override) the Equal method and then it will work