/// <inheritdoc /> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; if (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } if (TypeArray != null) { hashCode = hashCode * 59 + TypeArray.GetHashCode(); } if (Color != null) { hashCode = hashCode * 59 + Color.GetHashCode(); } if (ColorArray != null) { hashCode = hashCode * 59 + ColorArray.GetHashCode(); } if (TypeSrc != null) { hashCode = hashCode * 59 + TypeSrc.GetHashCode(); } if (ColorSrc != null) { hashCode = hashCode * 59 + ColorSrc.GetHashCode(); } return(hashCode); } }
private static void CheckDiffers(TypeArray a, TypeArray b) { Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); Assert.IsFalse(a.Equals(b)); Assert.IsFalse(a.Equals((object)b)); }
private static void CheckEquals(TypeArray a, TypeArray b) { Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); Assert.That(a.Equals(b)); Assert.That(a.Equals((object)b)); }