Skip to content

Sprint 6 final project#6

Open
DanilaNigmatullin wants to merge 3 commits intomainfrom
sprint_6_final
Open

Sprint 6 final project#6
DanilaNigmatullin wants to merge 3 commits intomainfrom
sprint_6_final

Conversation

@DanilaNigmatullin
Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/test/java/com/example/CatTest.java Outdated
Cat cat = new Cat(felineMock);
List<String> actualFood = cat.getFood();

assertEquals(expectedFood, actualFood);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Для юнит-тестов применим подход: один тест, значит одна проверка. В этом тесте две проверки (Mockito.verify, assertEquals), а должна быть одна. Исправь, пожалуйста, этот момент во всем коде.

this.input = input;
}

@Parameterized.Parameters
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️Можно улучшить. В параметризованных тестах для аннотации Parameterized.Parameters лучше использовать аргумент name: @Parameterized.Parameters(name = "Тестовые данные: {0} {1}"), где {0}, {1} - индексы параметров. Это повысит информативность проверки

try {
new Lion((String) input, new Feline());
fail("Ожидалось исключение для пола: " + input);
} catch (Exception e) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️Можно улучшить. Негативные и позитивные тесты я бы разделила. Не использовала бы if в тесте

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.

3 participants