public void TestEqualsObject() { Vector2 first = new Vector2(1.2f, 3.4f); Vector2 second = new Vector2(5.6f, 7.8f); BoundingRectangle rectangle1 = new BoundingRectangle(first, second); BoundingRectangle rectangle2 = new BoundingRectangle(first, second); Assert.IsTrue(rectangle1.Equals((object)rectangle2)); Assert.IsFalse(rectangle2.Equals((object)(new BoundingRectangle()))); }
public void TestEquals() { Vector2 first = new Vector2(1.2f, 3.4f); Vector2 second = new Vector2(5.6f, 7.8f); BoundingRectangle rectangle1 = new BoundingRectangle(first, second); BoundingRectangle rectangle2 = new BoundingRectangle(first, second); Assert.IsTrue(rectangle1.Equals(rectangle2)); Assert.IsFalse(rectangle2.Equals(new BoundingRectangle())); }
public void TestEqualsWithIncompatibleObject() { BoundingRectangle rectangle = new BoundingRectangle(); Assert.IsFalse(rectangle.Equals("Hello World")); }
public void TestEqualsNull() { BoundingRectangle rectangle = new BoundingRectangle(); Assert.IsFalse(rectangle.Equals(null)); }