예제 #1
0
        public void Intersects_HasIntersection_ReturnsRect()
        {
            Rect2 rect         = new Rect2(10, 20, 50, 30);
            Rect2 outside      = new Rect2(35, 35, 100, 30);
            Rect2 intersection = new Rect2(35, 35, 25, 15);

            Assert.Equal(intersection, rect.Intersect(outside));
        }
예제 #2
0
        public void Intersects_NoIntersection_ReturnsEmpty()
        {
            Rect2 rect = new Rect2(10, 20, 50, 30);

            Rect2 outside = new Rect2(100, 20, 50, 30);

            Assert.Equal(Rect2.Empty, rect.Intersect(outside));
        }