Should I be using IEquatable to ease testing of factories?
问题 I often work with classes that represent entities produced from a factory. To enable easy testing of my factories easily I usually implement IEquatable<T> , whilst also overriding GetHashCode and Equals (as suggested by the MSDN). For example; take the following entity class which is simplified for example purposes. Typically my classes have a bunch more properties. Occasionally there is a also collection, which in the Equals method I check using SequenceEqual . public class Product :