Skip to content

Павлов Илья#11

Open
PavlovILYA wants to merge 1 commit into48x:masterfrom
PavlovILYA:master
Open

Павлов Илья#11
PavlovILYA wants to merge 1 commit into48x:masterfrom
PavlovILYA:master

Conversation

@PavlovILYA
Copy link

homework 1

Copy link
Owner

@48x 48x left a comment

Choose a reason for hiding this comment

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

Ошибки общие для всех тестов

String string1 = "qwerty";
String string2 = "Angelina";
List<String> B = new ArrayList<String>();
B = ClassToBeTested.sortStringsByLength(string1,string2);
Copy link
Owner

Choose a reason for hiding this comment

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

Лучше это объекдинить в одну строчку (во всех тестах)

Copy link
Owner

Choose a reason for hiding this comment

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

  • название переменной плохое.

try {
String string1 = "";
String string2 = "Angelina";
ClassToBeTested.sortStringsByLength(string1, string2);
Copy link
Owner

Choose a reason for hiding this comment

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

В блоке try лучше оставлять только операцию, которая должна привести к ошибке

} catch (IllegalArgumentException e) {
Assert.assertEquals("itemsCount must be greater than 0", e.getMessage());
}
try {
Copy link
Owner

Choose a reason for hiding this comment

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

Два разных кейса в одном тесте. Такое лучше разнести в разные тесты

}

@Test
public void sortStringsByLengthTest2() throws Exception {
Copy link
Owner

Choose a reason for hiding this comment

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

Обычно название тестового метода начинают с test, а не заканчивают им

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