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(); }
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(); }
private bool HaveIntersectionWithAnotherRectangle(Rectangle rectangle) { return(rectangles.Any(anotherRectangle => RectanglesChecker.HaveIntersection(rectangle, anotherRectangle))); }