public void UnRotatedRectanglesCollideCorrectly()
        {
            var rect1 = new BoundingRectangle(new Vector2d(5, 3), new Size2d(10, 6));
            var rect2 = new BoundingRectangle(new Vector2d(5, 3), new Size2d(3, 3));

            Assert.True(rect1.Intersects(rect2));
            Assert.True(rect2.Intersects(rect1));

            rect2.Position += 3;
            Assert.True(rect1.Intersects(rect2));
            Assert.True(rect2.Intersects(rect1));

            rect2.Position++;
            Assert.True(rect1.Intersects(rect2));
            Assert.True(rect2.Intersects(rect1));

            rect2.Position++;
            Assert.False(rect1.Intersects(rect2));
            Assert.False(rect2.Intersects(rect1));
        }
        public void RotatedRectanglesCollideCorrectly()
        {
            var rect1 = new BoundingRectangle(new Vector2d(2.5, 2.5), new Size2d(4.24, 2.83))
            {
                Rotation = - Math.PI / 4
            };
            var rect2 = new BoundingRectangle(new Vector2d(9, 4), new Size2d(6, 4));

            Assert.False(rect1.Intersects(rect2));
            Assert.False(rect2.Intersects(rect1));

            rect2.Position.X-=2;

            Assert.True(rect1.Intersects(rect2));
            Assert.True(rect2.Intersects(rect1));

            rect2.Rotation = Math.PI / 2;
            rect2.Position++;

            Assert.False(rect1.Intersects(rect2));
            Assert.False(rect2.Intersects(rect1));

            rect2.Rotation = Math.PI;
            rect2.Position--;

            Assert.True(rect1.Intersects(rect2));
            Assert.True(rect2.Intersects(rect1));

            rect2.Position.Y+=10;

            Assert.False(rect1.Intersects(rect2));
            Assert.False(rect2.Intersects(rect1));

            rect2.Position.Y -= 10;
            rect1.Position.X += 5;

            Assert.True(rect1.Intersects(rect2));
            Assert.True(rect2.Intersects(rect1));

            rect1.Position.X += 9;

            Assert.False(rect1.Intersects(rect2));
            Assert.False(rect2.Intersects(rect1));

            rect1.Rotation = 0;
            rect1.Position.X = 12;
            rect2.Rotation = Math.PI;

            Assert.True(rect1.Intersects(rect2));
            Assert.True(rect2.Intersects(rect1));
        }