Skip to content

Код задачи "Организация события" покрыт 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

Open
wants to merge 1 commit into
base: hippogriff-master-stream10
Choose a base branch
from

Conversation

psvm-dev
Copy link

No description provided.

@Fagan89
Copy link

Fagan89 commented May 24, 2025

Вижу ты написала тесты по одному классу. Валидацию и фильтры лучше в отдельном классе писать. А в сервисе считать что валидация корректна

@psvm-dev
Copy link
Author

Вижу ты написала тесты по одному классу. Валидацию и фильтры лучше в отдельном классе писать. А в сервисе считать что валидация корректна

Я тестирую корректность вызова валидации в методе. И если здесь всё отрабатывает правильно, то и работа самого валидатора считается корректной.

Copy link

@20cognosce 20cognosce left a comment

Choose a reason for hiding this comment

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

Сами тесты в порядке

Comment on lines +62 to +81
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;

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() {

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()

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.

4 participants