Example #1
0
        public void HaveIntersection_ReturnFalse(int x, int y, int width, int height)
        {
            var staticRectangle = layouter.PutNextRectangle(new Size(15, 15), new Point(5, 0));
            var rectangle       = layouter.PutNextRectangle(new Size(width, height), new Point(x, y));

            RectanglesChecker.HaveIntersection(rectangle, staticRectangle).Should().BeFalse();
        }
Example #2
0
        public void ReturnTwoNotIntersectingRectangles()
        {
            var rnd    = new Random();
            var first  = layouter.PutNextRectangle(new Size(rnd.Next(1, 100), rnd.Next(1, 100)));
            var second = layouter.PutNextRectangle(new Size(rnd.Next(1, 100), rnd.Next(1, 100)));

            RectanglesChecker.HaveIntersection(first, second).Should().BeFalse();
        }
Example #3
0
 private bool HaveIntersectionWithAnotherRectangle(Rectangle rectangle)
 {
     return(rectangles.Any(anotherRectangle => RectanglesChecker.HaveIntersection(rectangle, anotherRectangle)));
 }