Ejemplo n.º 1
0
        public static Rectangle[] GenerateNewLayout(Layouter layouter, int numberOfRectangles)
        {
            var rnd = new Random();

            for (var i = 0; i < numberOfRectangles; i++)
            {
                layouter.PutNextRectangle(new Size(rnd.Next(30, 50), rnd.Next(20, 40)));
            }
            return(layouter.GetRectangles());
        }
Ejemplo n.º 2
0
        public void FirstRectangleCorrectlyPlaced()
        {
            var newRect = cloudLayouter.PutNextRectangle(new Size(200, 100));

            Assert.AreEqual(new Rectangle(300, 350, 200, 100), newRect);
            Assert.AreEqual(center, newRect.GetCenterOfRectangle());
        }