public void IEquatable_NotEquals() { Box3D boxA = new Box3D(new Vector3(-75, 80, -20), 50, 9, 40); Box3D boxB = new Box3D(new Vector3(-100, 75, -40), new Vector3(-50, 85, 0)); Assert.IsTrue(boxA.Equals(boxA)); Assert.IsFalse(boxA.Equals(boxB)); Assert.IsFalse(boxB.Equals(boxA)); Assert.IsFalse(boxA == boxB); Assert.IsFalse(boxB == boxA); Assert.IsTrue(boxA != boxB); Assert.IsTrue(boxB != boxA); Assert.AreNotEqual(boxA.GetHashCode(), boxB.GetHashCode()); }
public void IEquatable_Equals() { #pragma warning disable 1718 Box3D boxA = new Box3D(new Vector3(-75, 80, -20), 50, 10, 40); Box3D boxB = new Box3D(new Vector3(-100, 75, -40), new Vector3(-50, 85, 0)); Assert.IsTrue(boxA.Equals(boxA)); Assert.IsTrue(boxA.Equals(boxB)); Assert.IsTrue(boxB.Equals(boxA)); Assert.IsTrue(boxA == boxA); Assert.IsTrue(boxA == boxB); Assert.IsTrue(boxB == boxA); Assert.IsFalse(boxA != boxA); Assert.IsFalse(boxA != boxB); Assert.IsFalse(boxB != boxA); Assert.AreEqual(boxA.GetHashCode(), boxB.GetHashCode()); #pragma warning restore 1718 }