Skip to content

Медников Матвей#273

Open
easyThingsLover wants to merge 3 commits intokontur-courses:masterfrom
easyThingsLover:master
Open

Медников Матвей#273
easyThingsLover wants to merge 3 commits intokontur-courses:masterfrom
easyThingsLover:master

Conversation

@easyThingsLover
Copy link

No description provided.

Comment on lines 17 to 18
angle += AngleStep;
radius += RadiusStep / (2 * Math.PI);
Copy link

Choose a reason for hiding this comment

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

Тут будто бы на 2п надо угол делить, а не радиус

Copy link

Choose a reason for hiding this comment

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

Да и вообще зачем делить. Это константа, пусть будет с нужным значением каким-то. Только желательно назвать его как-то типа AngleStepRadians, чтобы точно недопонимания не было


public class Visualizer
{
private readonly Font font = new("Times New Roman", 16);
Copy link

Choose a reason for hiding this comment

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

Вообще шрифт и цвета можно вынести в конструктор чтобы можно было при создании визуализатора указывать чего хочу

graphics.Clear(Color.FromArgb(0, 28, 39));

var center = new Point(imageWidth / 2, imageHeight / 2);
var layouter = new CircularCloudLayouter(center);
Copy link

Choose a reason for hiding this comment

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

layouter бы вынести в интерфейс ICloudLayouter и унести его в конструктор. Правда тогда лучше шрифт и цвета затолкать в аргументы метода, тогда даже создавать новый визуализатор на новый стиль не придётся

Указывать в конструкторе layouter лучше, так как он может работать по-разному. Может, ты захочешь вообще квадратом слова выставлять

Comment on lines 36 to 58
visualizer.DrawCloud(
new[] {
"Football", "Soccer", "Basketball", "Baseball", "Hockey",
"Tennis", "Volleyball", "Rugby", "Cricket", "Golf",
"Boxing", "MMA", "Wrestling", "Cycling", "Running",
"Marathon", "Sprint", "Swimming", "Diving", "Rowing",
"Skating", "Skiing", "Snowboarding", "Surfing", "Skateboard",
"Climbing", "Bouldering", "Gymnastics", "Karate", "Judo",
"Taekwondo", "Badminton", "TableTennis", "Handball", "WaterPolo",
"Lacrosse", "Softball", "AmericanFootball", "Fencing", "Archery",
"Triathlon", "Biathlon", "Decathlon", "Heptathlon", "Crossfit",
"Powerlifting", "Weightlifting", "Bodybuilding", "Yoga", "Pilates",
"Aerobics", "Zumba", "Parkour", "Freerun", "Motorsport",
"FormulaOne", "Rally", "Karting", "Esports", "Chess",
"Darts", "Bowling", "Snooker", "Billiards", "Polo",
"Kayaking", "Canoeing", "Windsurfing", "Kitesurfing", "Paragliding",
"Mountaineering", "TrailRunning", "Ultramarathon", "NordicWalking", "Orienteering",
"Stadium", "Arena", "Coach", "Referee", "Captain",
"Team", "League", "Tournament", "Championship", "Playoffs",
"Fitness", "Training", "Warmup", "Cooldown", "Stretching",
"Goal", "Assist", "Penalty", "Offense", "Defense",
"SprintFinish", "Record", "Medal", "Victory", "FairPlay"
},
Copy link

Choose a reason for hiding this comment

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

Тут, получается, на любой тест будет выведено одинаковое облако

Надо все тесты визуализатора вынести в отдельный файл и заставить TearDown выводить облако, которое генерирует визуализатор конкретного теста. И выйдет так, что есть простые юнит тесты на layouter и есть approval тесты на визуализатор, которые в случае падения говорят: "смотри что твой визуализатор навизуализировал. неправильно"

…earDown рисует облако, используя аргументы упавшего теста
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