Beispiel #1
0
        public void CalculateImageCenter()
        {
            var size = new Size(100, 50);

            var center = PaintHelper.CalculateCenterLocation(size);

            center.ShouldBeEquivalentTo(new Point(50, 25));
        }
Beispiel #2
0
        public void ComplexMoveRectangles()
        {
            var rectangles = Generate().ToList();
            var imageS     = PaintHelper.CalculateImageSize(rectangles);
            var offset     = PaintHelper.CalculateCenterLocation(imageS);

            var moved = rectangles.Select(x => new Rectangle(new Point(x.X + offset.X, x.Y + offset.Y), x.Size));

            moved.All(x => OnPicture(imageS, x)).Should().BeTrue();
        }