Skip to content

Commit

Permalink
test: 버그 해결을 위한 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yoondgu committed Nov 13, 2023
1 parent da2c754 commit 840c19e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,20 @@ void deletePin_Success() {
assertThat(pinRepository.existsById(pin.getId())).isFalse();
}

@DisplayName("핀 삭제 시, 토픽의 핀 개수를 1 감소시킨다.")
@Test
void deletePin_Success_decreaseTopicPinCount() {
//given
assertThat(pin.isDeleted()).isFalse();
int pinCountBeforeDelete = topic.getPinCount();

//when
adminCommandService.deletePin(pin.getId());

//then
assertThat(topic.getPinCount()).isEqualTo(pinCountBeforeDelete - 1);
}

@DisplayName("Admin인 경우, 핀 이미지를 삭제할 수 있다.")
@Test
void deletePinImage_Success() {
Expand Down

0 comments on commit 840c19e

Please sign in to comment.