Beispiel #1
0
        public void FirstRectangleAreInCenterOfTheCloud(int width, int height)
        {
            var firstRectangle  = cloudLayouter.PutNextRectangle(new Size(width, height));
            var rectangleCenter = firstRectangle.GetCenter();

            rectangleCenter.ShouldBeEquivalentTo(center);
        }
        private static void FillCloudWithRectangles(CloudLayouter cloud)
        {
            var rnd = new Random();

            for (var i = 0; i < CountOfRectangles; i++)
            {
                var width  = rnd.Next(MinSizeOfRectangle * 10, MaxSizeOfRectangle * 10);
                var height = rnd.Next(MinSizeOfRectangle, MaxSizeOfRectangle);

                var size = new Size(width, height);

                cloud.PutNextRectangle(size);
            }
        }