public void PutNextRectangle_InCenter_When(int centerX, int centerY, int rectangleWidth, int rectangleHeight) { var center = new Point(centerX, centerY); rectangleLayouter = new RectangleLayouter(center, new SpiralTrack(center, trackStep)); var rectangleSize = new Size(rectangleWidth, rectangleHeight); var leftTopLocation = new Point( (int)Math.Ceiling(center.X - rectangleSize.Width / 2d), (int)Math.Ceiling(center.Y - rectangleSize.Height / 2d) ); var expectedLocation = new Rectangle(leftTopLocation, rectangleSize); var rectangleLocation = rectangleLayouter.PutNextRectangle(rectangleSize); rectangleLocation.Should().Be(expectedLocation); }
public void SetUp() { spiralTrack = new SpiralTrack(new Point(0, 0), trackStep); rectangleLayouter = new RectangleLayouter(new Point(0, 0), spiralTrack); }
public void SetUp() { random = new Random(3559); cloud = new RectangleLayouter(new Point(1000, 1000)); }