Esempio n. 1
0
        public void Should_EquallyStretchFigure_InBothAxis()
        {
            var stretchCoefficient = (double)CloudLayoutCreator.GetInscribedSquare().Width /
                                     CloudLayoutCreator.GetCircumscribedSquare().Width;

            stretchCoefficient
            .Should()
            .BeGreaterOrEqualTo(0.8, "Figure stretched a lot in one axis");
        }
Esempio n. 2
0
        public void Should_DenselyPlaceRectangles_InShapeLikeSquare()
        {
            var rectangles      = CloudLayoutCreator.GetAllRectangles().ToList();
            var inscribedSquare = CloudLayoutCreator.GetInscribedSquare();

            // check if we don't have outliers
            rectangles
            .All(rect => inscribedSquare.IntersectsWith(rect))
            .Should()
            .BeTrue("Inner square should intersect with every rectangle");
        }