-
Notifications
You must be signed in to change notification settings - Fork 0
Sprint 6 final push #22
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?
Conversation
| when(felineMock.eatMeat()).thenReturn(List.of("Рыба", "Птицы")); | ||
| void testGetKittens() { | ||
| when(mockFeline.getKittens()).thenReturn(1); // обязательно для мока | ||
| assertEquals(1, cat.getKittens()); |
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.
⛔️Нужно исправить. Для юнит-тестов применим подход: один тест, значит одна проверка. В этом тесте две проверки (Mockito.verify, assertEquals), а должна быть одна. Исправь, пожалуйста, этот момент во всем коде.
| when(felineMock.getKittens()).thenReturn(3); | ||
| void testGetKittens() throws Exception { | ||
| Feline mockFeline = mock(Feline.class); | ||
| when(mockFeline.getKittens()).thenReturn(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.
⛔️Нужно исправить. Мок должен вести себя как реальный объект и возвращать 1
| @@ -0,0 +1 @@ | |||
|
|
|||
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.
⛔️Нужно исправить. Нет отчета о тестировании
627c64d to
31839c0
Compare
No description provided.