-
Notifications
You must be signed in to change notification settings - Fork 2k
Develop1 #1144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Develop1 #1144
Conversation
YulianaGusakova
commented
Oct 7, 2025
- собран Maven-проект в IntelliJ IDEA с использованием Java 11 и подключением библиотек JUnit 4, Jacoco, Mockito;
- покрыт юнит-тестами класс Burger;
- применены параметризация и моки;
- сгенерирован отчет с помощью Jacoco для оценки покрытия кода тестами.
| burger.addIngredient(mockIngredientSauce); | ||
| burger.addIngredient(mockIngredientBun); | ||
| burger.addIngredient(mockIngredientFilling); | ||
| assertEquals("После добавления трёх ингредиентов размер списка должен быть равен 3", 3, burger.ingredients.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Для юнит-тестов придерживаемся подхода: один тест, значит одна проверка. Если очень хочется несколько проверок -- тогда используем softAssertions. Поправь, пожалуйста, во всем коде
| assertEquals("Некорректное перемещение ингредиента между позициями", mockIngredientBun, burger.ingredients.get(1)); | ||
| } | ||
|
|
||
| @Parameterized.Parameters(name = "Цена булочки {0}, Ожидаемая итоговая цена {1}, Количество ингредиентов {2}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛔️Нужно исправить. Если в тестах не нужна параметризация, например, тест moveIngredientTest, то их нужно вынести в отдельный класс
…terizedTest, исправлен код в BurgerTest, изменен pom.xml