-
Notifications
You must be signed in to change notification settings - Fork 53
Код задачи "Организация события" покрыт unit-тестами #3078
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: hippogriff-master-stream10
Are you sure you want to change the base?
Код задачи "Организация события" покрыт unit-тестами #3078
Conversation
Вижу ты написала тесты по одному классу. Валидацию и фильтры лучше в отдельном классе писать. А в сервисе считать что валидация корректна |
Я тестирую корректность вызова валидации в методе. И если здесь всё отрабатывает правильно, то и работа самого валидатора считается корректной. |
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.
Сами тесты в порядке
User user; | ||
User userWithoutSkills; | ||
Event event; | ||
Event eventUpdates; | ||
Event eventWithoutSkills; | ||
List<Skill> skills; | ||
Skill skill1; | ||
Skill skill2; | ||
List<Long> skillIds; | ||
Long ownerId = 1L; | ||
Long userWithoutSkillsId = 2L; | ||
Long eventId = 1L; | ||
Long eventWithoutSkillsId = 2L; | ||
String eventTitle = "Test Event"; | ||
String eventWithoutSkillsTitle = "Event without Skills"; | ||
LocalDateTime baseTime = LocalDateTime.of(2025, 5, 1, 12, 0); | ||
String titleFilter = "Java"; | ||
List<Event> expectedEvents; | ||
Long nonExistentId = 999L; | ||
List<Event> events; |
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.
где модификаторы доступа? что можно сделать статикой - делай статикой, остальное пересоздавай в beforeeach
и чем прям много полей, ты их все используешь в тестах?
|
||
// тесты на метод create() | ||
@Test | ||
void testCreateEventShouldSuccessfullyCreateEventWithValidData() { |
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.
сreate_withValidData_shouldSuccessfullyCreateEvent
assertEquals(eventWithoutSkillsTitle, createdEvent.getTitle()); | ||
} | ||
|
||
// тесты на метод updateEvent() |
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.
не пиши пожалуйста комментарии которые не несут пользы
No description provided.