public static AttributeImpl AssertCloneIsEqual(AttributeImpl att) { AttributeImpl clone = (AttributeImpl) att.Clone(); Assert.AreEqual(att, clone, "Clone must be equal"); Assert.AreEqual(att.GetHashCode(), clone.GetHashCode(), "Clone's hashcode must be equal"); return clone; }
public static AttributeImpl AssertCopyIsEqual(AttributeImpl att) { AttributeImpl copy = (AttributeImpl) System.Activator.CreateInstance(att.GetType()); att.CopyTo(copy); Assert.AreEqual(att, copy, "Copied instance must be equal"); Assert.AreEqual(att.GetHashCode(), copy.GetHashCode(), "Copied instance's hashcode must be equal"); return copy; }