Skip to content

develop1#1274

Open
AngryNiko wants to merge 4 commits intoyandex-praktikum:mainfrom
AngryNiko:develop1
Open

develop1#1274
AngryNiko wants to merge 4 commits intoyandex-praktikum:mainfrom
AngryNiko:develop1

Conversation

@AngryNiko
Copy link

Сделан BurgerTest и класс Burger покрыт тестами

private Bun bun;

@Mock
private Ingredient ingredient1;

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 addIngredientTest() {
burger.addIngredient(ingredient1);

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. Поправь, пожалуйста, во всем коде


String receipt = burger.getReceipt();

assertTrue(receipt.contains("black bun"));

Choose a reason for hiding this comment

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

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


assertEquals(320f, actualPrice, 0.001f);
}

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Должен быть хотя бы один параметризированный тест

</execution>
</executions>
</plugin>
</plugins>

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.

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

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