Esempio n. 1
0
        public void IntersectsItself()
        {
            Rectangle rectangle1 = new Rectangle
            {
                X = 1,
                Y = 1,
                Size = 1
            };

            Assert.IsTrue(rectangle1.Intersect(rectangle1));
        }
Esempio n. 2
0
        public void IntersectsOut()
        {
            Rectangle rectangle1 = new Rectangle
            {
                X = 2,
                Y = 2,
                Size = 2
            };

            Rectangle rectangle2 = new Rectangle
            {
                X = 1,
                Y = 1,
                Size = 4
            };

            Assert.IsTrue(rectangle1.Intersect(rectangle2));
        }
Esempio n. 3
0
        public void IntersectsRightBottom()
        {
            Rectangle rectangle1 = new Rectangle
            {
                X = 2,
                Y = 2,
                Size = 2
            };

            Rectangle rectangle2 = new Rectangle
            {
                X = 3,
                Y = 3,
                Size = 2
            };

            Assert.IsTrue(rectangle1.Intersect(rectangle2));
        }
Esempio n. 4
0
        public void NotIntersects()
        {
            Rectangle rectangle1 = new Rectangle
            {
                X = 2,
                Y = 2,
                Size = 2
            };

            Rectangle rectangle2 = new Rectangle
            {
                X = 4,
                Y = 4,
                Size = 4
            };

            Assert.IsFalse(rectangle1.Intersect(rectangle2));
        }