Skip to content

Commit

Permalink
Поправил именование теста
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Vay committed Nov 16, 2024
1 parent 050cfd2 commit ea634c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
18 changes: 8 additions & 10 deletions cs/TagsCloudVisualization/Tests/CircularCloudLayouterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ public void PutNextRectangle_Rectangles_ShouldNotHaveIntersects() =>

[Test]
[Repeat(10)]
public void PutNextRectangle_AllRectanglesCenter_ShoulBeLikeInitCenter()
public void PutNextRectangle_CloudCenterMust_ShouldBeInLayoterCenter()
{
var center = cloudLayouter.Center;
var minRectangleSize = 1;
var maxRectangleSize = 10;
var treshold = maxRectangleSize / 2;

cloudLayouter.GenerateCloud(100, 10, maxRectangleSize);
var expectedDiscrepancy = maxRectangleSize;
var minRectangleSize = 1;
var center = cloudLayouter.Center;

cloudLayouter.GenerateCloud(100, minRectangleSize, maxRectangleSize);

var actualCenter = GetCenterOfAllRectangles(cloudLayouter.GeneratedRectangles);
actualCenter.X.Should().BeInRange(center.X - treshold, center.X + treshold);
actualCenter.Y.Should().BeInRange(center.Y - treshold, center.Y + treshold);
actualCenter.X.Should().BeInRange(center.X - expectedDiscrepancy, center.X + expectedDiscrepancy);
actualCenter.Y.Should().BeInRange(center.Y - expectedDiscrepancy, center.Y + expectedDiscrepancy);
}

[Test]
Expand Down Expand Up @@ -131,8 +131,6 @@ private double GetMaxDistanceBetweenRectangleAndCenter(List<Rectangle> rectangle
return maxDistance;
}



private static bool AreRectanglesHaveIntersects(List<Rectangle> rectangles)
{
for (var i = 0; i < rectangles.Count; i++)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;

namespace TagsCloudVisualization.Visualizers;

Expand Down

0 comments on commit ea634c8

Please sign in to comment.