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

Зиновьева Милана #244

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

crycrash
Copy link

No description provided.

Comment on lines 15 to 19
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Copy link

Choose a reason for hiding this comment

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

не используемые зависимости стоит удалить


namespace Layouter;

class Spiral
Copy link

Choose a reason for hiding this comment

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

Название не передает сути

Copy link

Choose a reason for hiding this comment

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

Стоит поправить

Comment on lines 40 to 44
foreach(Rectangle rectangle in rectangles){
if (rectangleChecked.IntersectsWith(rectangle))
return true;
}
return false;
Copy link

Choose a reason for hiding this comment

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

Предлагаю переписать на linq

[Test]
public void PutNextRectangle_PutSeveralRectangles(){
Size rectangleSize = new Size(3, 7);
for(int i = 0;i < 20;i++){
Copy link

Choose a reason for hiding this comment

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

Стоит использовать автоформатирование кода. Если используешь райдер, можно настроить автоформатирование при коммите


namespace Layouter;

class Spiral
Copy link

Choose a reason for hiding this comment

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

Стоит поправить

Comment on lines 37 to 39
canvas.FillRectangle(rect.X, rect.Y,
rect.Width,
rect.Height);
Copy link

Choose a reason for hiding this comment

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

При разбиении на строки, стоит либо на каждый аргумент выделять строку, либо в каждую строку помещать элементы вплоть до стандартной границы. Тут всё влезет на одну строку

<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
Copy link

Choose a reason for hiding this comment

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

Выдели тесты в отдельный проект

}

[Test]
public void PutNextRectangle_LessThanAreaOfCircle()
Copy link

Choose a reason for hiding this comment

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

Наоборот быть и не может, тест не имеет смысла

Comment on lines 58 to 59
circularCloudLayouter.GetRectangles.Count().Should().Be(1);
circularCloudLayouter.GetRectangles.Should().Contain(expectedRectangle);
Copy link

Choose a reason for hiding this comment

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

collection.Should().ContainSingle()
https://fluentassertions.com/collections/

{
circularCloudLayouter.PutNextRectangle(rectangleSize);
}
circularCloudLayouter.GetRectangles.Count().Should().Be(20);
Copy link

Choose a reason for hiding this comment

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

collection.Should().HaveCount()
https://fluentassertions.com/collections/


private List<Rectangle> rectangles;

public Point GetCenter => centercloud;
Copy link

Choose a reason for hiding this comment

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

опечатка

private ICanvas Draw(ICanvas canvas)
{
canvas.FillColor = Colors.Blue;
canvas.FontColor = Colors.Black;
Copy link

Choose a reason for hiding this comment

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

Зачем ты дважды задала цвет шрифту?

return rectangle;
}

private Rectangle CanMove(Rectangle rectangle, bool isX, int direction)
Copy link

Choose a reason for hiding this comment

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

Can в названии подразумевает, что вернется bool из метода и он не будет что-то менять. Стоит переименовать

Comment on lines 71 to 73
var movedRectangle = new Rectangle(
new Point(rectangle.X + shiftPoint.X, rectangle.Y + shiftPoint.Y),
rectangle.Size);
Copy link

Choose a reason for hiding this comment

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

Comment on lines 30 to 31
drawingTagsCloud.SaveToFile("Failed.png"); //сохраняется в bin
Console.WriteLine("Tag cloud visualization saved to file Failed.png");
Copy link

Choose a reason for hiding this comment

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

А если упадет несколько тестов?

Comment on lines +12 to +23
<ItemGroup>
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Using Include="NUnit.Framework" />
</ItemGroup>
Copy link

Choose a reason for hiding this comment

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

Неиспользуемые пакеты стоит удалять из проекта

do
{
Point nextPoint = spiral.GetNextPoint();
tempRectangle = new Rectangle(new Point(nextPoint.X, nextPoint.Y), rectangleSize);
Copy link

Choose a reason for hiding this comment

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

так же можно было использовать with expression

private readonly System.Drawing.Point centercloud;
private readonly List<Rectangle> rectangles;

public DrawingTagsCloud(System.Drawing.Point center, List<Rectangle> rectanglesInput)
Copy link

Choose a reason for hiding this comment

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

Указание типа точки можно сделать короче

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants