Exemplo n.º 1
0
        public void BoundingBox_ShouldBeApproximatelySquare(int numberOfRectangles)
        {
            var allCorners = PutRectanglesOnLayout(
                Enumerable.Range(0, numberOfRectangles)
                .Select(i => new Size(1, 1)))
                             .SelectMany(rectangle => rectangle.Corners);

            var boundingBox = Rectangle.BoundingBoxOf(allCorners).Value;

            boundingBox.Size.Width.Should()
            .BeGreaterThan(boundingBox.Size.Height / 2)
            .And
            .BeLessThan(boundingBox.Size.Height * 2);
        }