Let's say we are testing the result of a method by asserting the equality of all the properties of the result object with properties of an expected result object. Should we implement equals method and use Assert.AreEqual(expectedResult, actualResult)... But equals may mean something different in production code.
Which is the best practice?
- Asserting the equality of the objects through overriden equals method
or
- Asserting the equality of all the properties