public void TestEquality() { var a = new Warp(1) { [0] = new RectangleD(0, 0, 0, 0) }; var b = (Warp)a.Clone(); b[0] = new RectangleD(0, 0, -0.15, -0.15); Assert.AreEqual(a, a); Assert.AreEqual(b, b); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); var warps = new HashSet <Warp> { a, b }; Assert.AreNotEqual(warps.First(), warps.Last()); }