public static void EncapsulateRect_ResizesProperly() { IntRect a = new IntRect(1, 1, 5, 5); IntRect b = new IntRect(0, 0, 10, 10); a.Encapsulate(b); Assert.AreEqual(10, a.size_.x); Assert.AreEqual(10, a.size_.y); }
public static void EncapsulatePoint_BottomLeftPoint_ResizesProperly() { IntRect rect = new IntRect(5, 5, 1, 1); var p = new Vector3(0, 0, 0); rect.Encapsulate(p); Assert.AreEqual(6, rect.size_.x); Assert.AreEqual(6, rect.size_.y); p.x = -5; rect.Encapsulate(p); Assert.AreEqual(11, rect.size_.x); }
public static void EncapsulatePoint_UpperRightPoint_ResizesProperly() { IntRect rect = new IntRect(5, 5, 1, 1); var p = new Vector3(8, 8, 8); rect.Encapsulate(p); Assert.AreEqual(4, rect.size_.x); Assert.AreEqual(4, rect.size_.y); p.x = 15; rect.Encapsulate(p); Assert.AreEqual(11, rect.size_.x); }