Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Леонид Рыбин #251

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
refactor tests
JavaScriptHaters committed Nov 18, 2024
commit 1f5c3bc25fd3d92d768209523132abab37bf8a1a
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ namespace TagsCloudVisualization.Layouters;
public class CircularCloudLayouter : ICloudLayouter
{
private const double DefaultRadius = 1;
private const double DefaultAngleOffset = 10;
private const double DefaultAngleOffset = 0.5;
private readonly Point center;
public readonly List<Rectangle> rectangles;
private readonly CircularSpiralPointGenerator pointsGenerator;
6 changes: 2 additions & 4 deletions cs/TagsCloudVisualizationTests/CircularCloudLayouterTests.cs
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@ public class CircularCloudLayouterTests
private const string ImagesDirectory = "TestImages";

private static readonly Point OptimalCenter = new(0, 0);
private readonly double OptimalRadius = 1;
private readonly double OptimalAngleOffset = 0.5;

[TearDown]
public void TearDown()
@@ -95,7 +93,7 @@ private static bool IsIntersectionBetweenRectangles(Rectangle[] rectangles)
public void TagsCloud_ShouldBeShapeOfCircularCloud_WhenOptimalParameters()
{
var rectanglesNumber = 1000;
var circularCloudLayouter = new CircularCloudLayouter(OptimalCenter, OptimalRadius, OptimalAngleOffset);
var circularCloudLayouter = new CircularCloudLayouter(OptimalCenter);

rectangles = circularCloudLayouter.GenerateCloud(rectanglesNumber, 10, 25);
var layoutSize = GetLayoutSize();
@@ -122,7 +120,7 @@ private Size GetLayoutSize()
public void TagsCloud_ShouldBeDense_WhenOptimalParameters()
{
var rectanglesNumber = 1000;
var circularCloudLayouter = new CircularCloudLayouter(OptimalCenter, OptimalRadius, OptimalAngleOffset);
var circularCloudLayouter = new CircularCloudLayouter(OptimalCenter);
rectangles = circularCloudLayouter.GenerateCloud(rectanglesNumber, 10, 10);

var expectedRectanglesArea = (double)rectanglesNumber * 10 * 10;
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ public void CircularSpiralPointGenerator_WhenCorrectArgs_NotThrowArgumentExcepti
public void GetPoint_ReturnCorrectPoints()
{
var spiral = new CircularSpiralPointGenerator(3, 100, DefaultCenter);
var actualPoins = new Point[6];
Point[] correctPoints =

This comment was marked as resolved.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var correctPoints = new[] { ... };

{
new Point(0, 0),