public void PutNextRectangleAddsFirstRectanglesToCenter()
        {
            var cloud     = new CircularCloudLayouter(center);
            var rectangle = cloud.PutNextRectangle(sizes.First());

            rectangle.Left.Should().Be(85);
            rectangle.Right.Should().Be(115);
            rectangle.Top.Should().Be(95);
            rectangle.Bottom.Should().Be(105);
        }
        public void PutNextRectangleFillsTopSideCorrectly()
        {
            var cloud = new CircularCloudLayouter(center);

            PutRectangles(cloud, 3);
            var lastTopRectangle = cloud.PutNextRectangle(new Size(10, 5));

            lastTopRectangle.Left.Should().Be(105);
            lastTopRectangle.Right.Should().Be(115);
            lastTopRectangle.Top.Should().Be(90);
            lastTopRectangle.Bottom.Should().Be(95);
        }
        public void PutNextRectangleAddsTwoRectanglesCorrectly()
        {
            var cloud = new CircularCloudLayouter(center);

            cloud.PutNextRectangle(sizes.First());
            var secondRectangle = cloud.PutNextRectangle(sizes.Skip(1).First());

            secondRectangle.Left.Should().Be(85);
            secondRectangle.Right.Should().Be(95);
            secondRectangle.Top.Should().Be(90);
            secondRectangle.Bottom.Should().Be(95);
        }
        public void PutNextRectangleCorrectlyAddsFirstRectangle_AfterNewPivot()
        {
            var cloud = new CircularCloudLayouter(center);

            PutRectangles(cloud, 12);
            var lastRectangle = cloud.PutNextRectangle(new Size(10, 5));

            lastRectangle.Left.Should().Be(70);
            lastRectangle.Right.Should().Be(80);
            lastRectangle.Top.Should().Be(80);
            lastRectangle.Bottom.Should().Be(85);
        }
        public void PutNextRectangleFillsAllSidesCorrectly()
        {
            var cloud = new CircularCloudLayouter(center);

            PutRectangles(cloud, 11);
            var lastRectangle = cloud.PutNextRectangle(sizes.Last());

            lastRectangle.Left.Should().Be(70);
            lastRectangle.Right.Should().Be(85);
            lastRectangle.Top.Should().Be(85);
            lastRectangle.Bottom.Should().Be(100);
        }
        public void PutNextRectangleThrowsException_WhenOutOfBounds(Point centerPoint, Size size)
        {
            var cloud = new CircularCloudLayouter(centerPoint);

            cloud.Invoking(c => c.PutNextRectangle(size)).ShouldThrow <ArgumentOutOfRangeException>();
        }