示例#1
0
 public static void GetIntersection_HandlesNegativesCorrectly()
 {
     Assert.That(RectangularLove.GetIntersection(new Rectangle(-2, -2, 2, 2), new Rectangle(-1, -1, 2, 2)), Is.EqualTo(new Rectangle(-1, -1, 1, 1)));
 }
示例#2
0
 public static void GetIntersection_Enclosed_ReturnsExpected()
 {
     Assert.That(RectangularLove.GetIntersection(new Rectangle(1, 1, 3, 3), new Rectangle(2, 2, 2, 2)), Is.EqualTo(new Rectangle(2, 2, 2, 2)));
 }
示例#3
0
 public static void GetIntersection_HandlesNullCorrectly()
 {
     Assert.Throws <ArgumentNullException>(() => RectangularLove.GetIntersection(null, null));
 }
示例#4
0
 public static void GetIntersection_TouchingOverlap_ReturnsExpected()
 {
     Assert.That(RectangularLove.GetIntersection(new Rectangle(1, 1, 2, 2), new Rectangle(3, 3, 2, 2)), Is.EqualTo(null));
 }
示例#5
0
 public static void GetIntersection_BasicExample_ReturnsExpected()
 {
     Assert.That(RectangularLove.GetIntersection(new Rectangle(1, 1, 2, 2), new Rectangle(2, 2, 2, 2)), Is.EqualTo(new Rectangle(2, 2, 1, 1)));
 }