Skip to content

Conversation

@fe-y
Copy link
Owner

@fe-y fe-y commented Oct 6, 2025

No description provided.

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Папку .idea не нужно было загружать в репозиторий. Эта папка должна быть добавлена в .gitignore.

pom.xml Outdated
</dependency>

<!-- Зависимость Gson для работы с JSON -->
<dependency>

Choose a reason for hiding this comment

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

⛔️Нужно исправить. данном задание с Gson не работаем

import junitparams.Parameters;

@RunWith(JUnitParamsRunner.class)
public class BunTest {

Choose a reason for hiding this comment

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

⚠️Можно улучшить. Согласно заданию, тестируем только класс Burger


private Burger burger;
private Bun bunMock;
private Ingredient ingredientMock1;

Choose a reason for hiding this comment

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

⛔️Нужно исправить. При нейминге не рекомендуется использовать числа (Field2), их еще называют magicNumbers. Очень тяжело поддерживать код с magicNumbers.

public void testAddIngredient() {
burger.setBuns(bunMock);
burger.addIngredient(ingredientMock1);
assertEquals(1, burger.ingredients.size());

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Для юнит-тестов придерживаемся подхода: один тест, значит одна проверка. Если очень хочется несколько проверок -- тогда используем softAssertions. Поправь, пожалуйста, во всем коде

private Burger burger;
private Bun bunMock;
private Ingredient ingredientMock1;
private Ingredient ingredientMock2;

Choose a reason for hiding this comment

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

⛔️Нужно исправить. По заданию для бургер тестов нужно реализовать параметризированные тесты. Какие именно, решай сама

burger.addIngredient(fillingIngredient);

burger.moveIngredient(0, 1);
assertEquals(fillingIngredient, burger.ingredients.get(0));

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Для юнит-тестов придерживаемся подхода: один тест, значит одна проверка. Если очень хочется несколько проверок -- тогда используем softAssertions. Поправь, пожалуйста, во всем коде

public void testReceiptContainsBunName() {
burger.setBuns(bunMock);
String receipt = burger.getReceipt();
assertTrue(receipt.contains(bunMock.getName()));

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Необходимо проверять строку рецепта целиком. Иначе, можно пропустить ошибки форматирования текста

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Нужно оставить только папку jacoco. Остальные файлы удалить из пулл реквеста

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