public void Equality(CircleF circle1, CircleF circle2, bool expectedToBeEqual) { Assert.IsTrue(Equals(circle1, circle2) == expectedToBeEqual); Assert.IsTrue(circle1 == circle2 == expectedToBeEqual); Assert.IsFalse(circle1 == circle2 != expectedToBeEqual); Assert.IsTrue(circle1.Equals(circle2) == expectedToBeEqual); if (expectedToBeEqual) { Assert.AreEqual(circle1.GetHashCode(), circle2.GetHashCode()); } }
public void HashCode(CircleF circle1, CircleF circle2, bool expectedThatHashCodesAreEqual) { var hashCode1 = circle1.GetHashCode(); var hashCode2 = circle2.GetHashCode(); if (expectedThatHashCodesAreEqual) { Assert.AreEqual(hashCode1, hashCode2); } else { Assert.AreNotEqual(hashCode1, hashCode2); } }