Skip to content

Commit

Permalink
test: 콕 찌르기 여부를 확인하는 기능 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
hongdosan committed Nov 7, 2023
1 parent 50e3b04 commit beb7df8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ void participantSearchRepository_findAllByRoomCertifyTime(Room room, List<Partic
List<Participant> actual = participantSearchRepository.findAllByRoomCertifyTime(10);

// Then
assertThat(actual).hasSize(3);
assertThat(actual).hasSize(5);
}

@DisplayName("특정 방에서 본인을 제외한 참여자 조회를 성공적으로 했을 때, - List<Participant>")
@MethodSource("com.moabam.support.fixture.ParticipantFixture#provideRoomAndParticipants")
@ParameterizedTest
void participantSearchRepository_findOtherParticipantsInRoom(Room room, List<Participant> participants) {
// Given
roomRepository.save(room);
participantRepository.saveAll(participants);

// When
List<Participant> actual = participantSearchRepository.findOtherParticipantsInRoom(7L, room.getId());

// Then
assertThat(actual).hasSize(4);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public static Stream<Arguments> provideRoomAndParticipants() {
List.of(
ParticipantFixture.participant(room, 1L),
ParticipantFixture.participant(room, 2L),
ParticipantFixture.participant(room, 3L)
ParticipantFixture.participant(room, 3L),
ParticipantFixture.participant(room, 5L),
ParticipantFixture.participant(room, 7L)
))
);
}
Expand Down

0 comments on commit beb7df8

Please sign in to comment.