Skip to content

Add BurgerTest with 100% coverage#1302

Open
DanilaNigmatullin wants to merge 3 commits intoyandex-praktikum:mainfrom
DanilaNigmatullin:develop1
Open

Add BurgerTest with 100% coverage#1302
DanilaNigmatullin wants to merge 3 commits intoyandex-praktikum:mainfrom
DanilaNigmatullin:develop1

Conversation

@DanilaNigmatullin
Copy link
Copy Markdown

Подключены JUnit 4, Mockito, JaCoCo. Написаны тесты для класса Burger, покрытие 100%

@Test
public void addIngredientAddsOneIngredient() {
burger.addIngredient(mockSauce);
assertEquals(1, burger.ingredients.size());
Copy link
Copy Markdown

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("Булочка"));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread praktikum.iml Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Файл нужно добавить в .gitignore

String receipt = burger.getReceipt();
assertTrue(receipt.contains("cutlet"));
}
} No newline at end of file
Copy link
Copy Markdown

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