Skip to content

Вильданов Савелий #202

Open
Saveliy21 wants to merge 1 commit intokontur-courses:masterfrom
Saveliy21:master
Open

Вильданов Савелий #202
Saveliy21 wants to merge 1 commit intokontur-courses:masterfrom
Saveliy21:master

Conversation

@Saveliy21
Copy link
Copy Markdown

Direction.Right => Direction.Down,
Direction.Down => Direction.Left,
Direction.Left => Direction.Up,
_ => throw new ArgumentOutOfRangeException(nameof(direction), direction, null)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Вместо исключений всюду в программе используй паттерн Result

Direction.Right => new Size(Step, 0),
Direction.Down => new Size(0, -Step),
Direction.Left => new Size(-Step, 0),
_ => throw new ArgumentOutOfRangeException(nameof(direction))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Вместо исключений всюду в программе используй паттерн Result

{
return Result.Fail<IEnumerable<string>>($"Access to the file is denied: {filePath}");
}
catch (IOException ex)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Тут можно, наверн, чуть ли не любую ошибку ловить, чтобы наверняка

public static void SaveImage(Bitmap bmp, string fileName, string imageFormat)
{
fileName = $"{fileName}.{imageFormat.ToLower()}";
bmp.Save(fileName);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Как будто тут у нас вполне может что-то стрельнуть, нет?

.Returns(Rectangle);
A.CallTo(() => cloudLayouter.PutNextRectangle(new Size(500, 100)))
.Returns(Rectangle);

Copy link
Copy Markdown

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