Пример #1
0
        public void ReturnCenter_ThenGettingFirstPoint(int x, int y)
        {
            var spiral = new SpiralBuilder()
                         .WithCenterIn(new Point(x, y))
                         .Build();

            var result = spiral.GetNextPoint();

            result.Should().Be(new Point(x, y));
        }
Пример #2
0
        public void ReturnDifferentPoints(double stepLength)
        {
            var spiral = new SpiralBuilder()
                         .WithStepLength(stepLength)
                         .Build();

            var first  = spiral.GetNextPoint();
            var second = spiral.GetNextPoint();

            first.Should().NotBe(second);
        }
Пример #3
0
        public void ReturnCorrectRectangle_AfterPuttingRectangleSize(int width, int height, int centerX, int centerY)
        {
            var center = new Point(centerX, centerY);
            var spiral = new SpiralBuilder()
                         .WithCenterIn(center)
                         .Build();
            var tagCloud = new CircularCloudLayouter(spiral);

            var result = tagCloud.PutNextRectangle(new Size(width, height));

            result.Should().BeEquivalentTo(new Rectangle(center.X - width / 2, center.Y - height / 2,
                                                         width, height));
        }