Skip to content

Добавил test/java/homework(Вышегородцев)#4

Open
kronoker wants to merge 3 commits into48x:masterfrom
kronoker:master
Open

Добавил test/java/homework(Вышегородцев)#4
kronoker wants to merge 3 commits into48x:masterfrom
kronoker:master

Conversation

@kronoker
Copy link

No description provided.

@kronoker kronoker changed the title Добавил test/java/homework Добавил test/java/homework(Вышегородцев) May 10, 2018
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Owner

Choose a reason for hiding this comment

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

Мусор от IDE и скомпилированный проект закидывать в репу - плохо и не надо.

public void testThrowingExceptionIfItemsCountIsLessZero() {
Random random = new Random();
try {
ClassToBeTested.generateIntSequence(random.nextInt(), -random.nextInt(Integer.MAX_VALUE) - 2);
Copy link
Owner

Choose a reason for hiding this comment

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

Рандом + отрицание - усложение читабельности теста. Лучше обойтись без этого, тем более тут это можно легко сделать

int min = Integer.MAX_VALUE / 2 + 1;
int max = Integer.MAX_VALUE;
int randomNumber1 = (int) (Math.random() * (max - min)) + min;
int randomNumber2 = (int) (Math.random() * (max - min)) + min;
Copy link
Owner

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