I’m testing two objects (and a collection of them) but it fails even though they have the same type:

I have done some research and its maybe because of the references, which they could be different. However, its still the same type and I don’t know what Assert method to use. (The CollectionAssert.AreEquivalent also fails).
Edited
I’m also trying to check if the values of each field are the same, in that case, should I do an Assert.AreEqual for each field?
— thanks, all of the answers were helpful
If you want to compare values for your dto objects then you have to override
EqualsandGetHashCodemethods.For example given the class:
If you consider that two objects of DTOPersona class with the same Name (but not Address) are the equivalent objects (i.e. the same person), your code could look something like this: