public void InitArchimedesSpiral_Throws_IncorrectArguments(float angleStep, int spiralParameter = 1) { var spiralParams = new SpiralParams(spiralParameter, angleStep); Assert.Throws <ArgumentException>( () => new ArchimedesSpiral(spiralParams, canvas.GetImageCenter())); }
public void SetUp() { spiralParams = new SpiralParams(); canvas = new Canvas(new ImageSettings { Width = 500, Height = 500 }); sut = new ArchimedesSpiral(spiralParams, canvas.GetImageCenter()); }
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; }
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); }