Esempio n. 1
0
        public void InitArchimedesSpiral_Throws_IncorrectArguments(float angleStep,
                                                                   int spiralParameter = 1)
        {
            var spiralParams = new SpiralParams(spiralParameter, angleStep);

            Assert.Throws <ArgumentException>(
                () => new ArchimedesSpiral(spiralParams, canvas.GetImageCenter()));
        }
Esempio n. 2
0
 public void SetUp()
 {
     spiralParams = new SpiralParams();
     canvas       = new Canvas(new ImageSettings {
         Width = 500, Height = 500
     });
     sut = new ArchimedesSpiral(spiralParams, canvas.GetImageCenter());
 }
Esempio n. 3
0
 public ExampleAction(
     ITagCloudBuilder tagCloudBuilder, ICloudVisualizer cloudVisualizer,
     ITextReader textReader, ITextHandler textHandler, SpiralParams spiralParams)
 {
     this.tagCloudBuilder = tagCloudBuilder;
     this.cloudVisualizer = cloudVisualizer;
     this.textReader      = textReader;
     this.textHandler     = textHandler;
     this.spiralParams    = spiralParams;
 }
Esempio n. 4
0
        public void GetNextGeneratedPoint_ShouldConsistentlyReturnsNextSpiralPoints(int spiralParameter, float angleStep,
                                                                                    params int[] expectedPointCoordinates)
        {
            var spiralParams     = new SpiralParams(spiralParameter, angleStep);
            var archimedesSpiral = new ArchimedesSpiral(spiralParams, canvas.GetImageCenter());
            var expectedPoints   = new Point[3];

            for (int i = 0; i < expectedPoints.Length; i++)
            {
                expectedPoints[i] = new Point(expectedPointCoordinates[i * 2], expectedPointCoordinates[i * 2 + 1]);
            }

            var actualPoints = new Point[3];

            for (int i = 0; i < 3; i++)
            {
                actualPoints[i] = archimedesSpiral.GetNextPoint();
            }

            actualPoints.Should().Equal(expectedPoints);
        }