public void LayOutRectangles_Tightly(double ratioOfAreas, int numOfRectangles)
        {
            layouter = FillUpLayout(layouter, numOfRectangles);
            var center           = new Point(screenBounds.Width / 2, screenBounds.Height / 2);
            var radius           = layouter.Layout().Select(rectangle => GetMaxDistance(rectangle, center)).Max();
            var areaOfRectangles = layouter.Layout().Sum(r => (double)r.Height * r.Width);
            var areaOfCircle     = Math.PI * Math.Pow(radius, 2);

            areaOfRectangles.Should().BeGreaterThan(areaOfCircle * ratioOfAreas);
        }
        private CircularCloudLayouter FillUpLayout(CircularCloudLayouter layouter, int numOfRectangles)
        {
            var rnd = new Random();

            for (var i = 0; i < numOfRectangles; i++)
            {
                layouter.PutNextRectangle(new Size(rnd.Next(10, 100), rnd.Next(10, 100)));
            }
            return(layouter);
        }
        public void LayOutRectangles_WithoutIntersection(int numOfRectangles)
        {
            layouter = FillUpLayout(layouter, numOfRectangles);
            var layout = layouter.Layout();

            foreach (var rectangleA in layout)
            {
                foreach (var rectangleB in layout)
                {
                    if (rectangleA != rectangleB)
                    {
                        rectangleA.IntersectsWith(rectangleB).Should().Be(false);
                    }
                }
            }
        }
 public void AddingRectanglesToLayout(int numOfRectangles)
 {
     layouter = FillUpLayout(layouter, numOfRectangles);
     layouter.Layout().Count.Should().Be(numOfRectangles);
 }
        public void SetUp()
        {
            var cloudDesign = new SimpleCloudDesign(Color.FromName("White"), "", new SolidBrush(Color.FromName("Black")), screenBounds);

            layouter = new CircularCloudLayouter(new SpiralCloudShape(cloudDesign));
        }