I have 2 objects (one hand crafted that is my expected and one is coming from the database) and I'm trying to ensure they are equal. Not as in that they are the same reference but that the data within them matches.
I'm using Assert.AreEqual()
but only get generic error messages such as.
Expected: <Namespace.ObjectFoo>
But was: <Namespace.ObjectFoo>
How can I drill to further to display which properties don't match?
Add a .ToString()
override on the Namespace.ObjectFoo class that describes the object's contents. The <Namespace.ObjectFoo>
is the output from the implementation of .ToString()
defined on System.Object
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With