Skip to content

Юнит-тесты для Burger с 100% покрытием#1297

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

Юнит-тесты для Burger с 100% покрытием#1297
yellowDucklingVi wants to merge 4 commits intoyandex-praktikum:mainfrom
yellowDucklingVi:develop1

Conversation

@yellowDucklingVi
Copy link
Copy Markdown

  • Подключены JUnit 4, Mockito, JaCoCo.
  • Класс Burger покрыт тестами на 100% (отчёт в папке jacoco-report).
  • Использованы моки, стабы и параметризация.

Bun bunMock = mock(Bun.class);
when(bunMock.getPrice()).thenReturn(100f);

Ingredient i1 = mock(Ingredient.class);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

public class BurgerPriceParameterizedTest {

private static final float BUN_PRICE = 100f;
private static final float INGREDIENT_PRICE_1 = 50f;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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