If I had a custom class that inherits from Collection called LookUpValueCollection that handle only types of the class LookUpValueCollection, to use the method CollectionAssert with Visual Studio test Do I need to implement the method IEqual to handle the comparison? Because I used and despite of two collection are similar still says that the objets inside are different.
If I had a custom class that inherits from Collection called LookUpValueCollection that handle
Share
Yes, the elements of the collection need to override
Equals(andGetHashCode). Otherwise, the elements will be compared by reference, so they won’t be considered equal if they’re not the same instance.