Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Tests.Datatypes.RectangleTests
2 unit tests call DeltaEngine.Datatypes.Rectangle.Equals(DeltaEngine.Datatypes.Rectangle)
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- other
- Type: DeltaEngine.Datatypes Rectangle
Return Value
Type: BooleanImplements
IEquatable T Equals(T)Remarks
Examples
[Test] public void Equals() { var rect1 = new Rectangle(3, 4, 1, 2); var rect2 = new Rectangle(5, 6, 1, 2); Assert.AreNotEqual(rect1, rect2); Assert.AreEqual(rect1, new Rectangle(3, 4, 1, 2)); Assert.AreNotEqual(rect1, new Rectangle(3.00001f, 4, 1, 2)); Assert.IsTrue(rect1 == new Rectangle(3, 4, 1, 2)); Assert.IsTrue(rect1 != rect2); Assert.IsFalse(rect1.Equals(rect2)); Assert.IsTrue(rect1.Equals(rect1)); Assert.False(rect1.Equals((object)Rectangle.One)); }
[Test] public void NearlyEquals() { var rect1 = new Rectangle(3, 4, 1, 2); Assert.IsTrue(rect1.IsNearlyEqual(new Rectangle(3.00001f, 4, 1, 2))); Assert.IsTrue(rect1.IsNearlyEqual(new Rectangle(3, 4, 0.99999f, 2))); Assert.IsFalse(rect1.IsNearlyEqual(new Rectangle(3.01f, 4, 1, 2))); Assert.IsFalse(rect1.IsNearlyEqual(new Rectangle(3, 4, 0.999f, 2))); }
See Also