use of wooteco.prolog.member.application.dto.MemberScrapResponse in project prolog by woowacourse.
the class StudylogScrapServiceTest method registerScrapTest.
@DisplayName("스크랩 등록기능 확인")
@Test
void registerScrapTest() {
// given
MemberScrapResponse memberScrapResponse = studylogScrapService.registerScrap(member.getId(), studylog.getId());
// when
MemberResponse memberResponse = memberScrapResponse.getMemberResponse();
StudylogResponse studylogResponse = memberScrapResponse.getStudylogResponse();
// then
assertThat(member.getId()).isEqualTo(memberResponse.getId());
assertThat(studylog.getId()).isEqualTo(studylogResponse.getId());
}
use of wooteco.prolog.member.application.dto.MemberScrapResponse in project prolog by woowacourse.
the class StudylogScrapServiceTest method unregisterScrapTest.
@DisplayName("스크랩 삭제기능 확인")
@Test
void unregisterScrapTest() {
// given
MemberScrapResponse memberScrapResponse = studylogScrapService.registerScrap(member.getId(), studylog.getId());
// when
Long studylogId = memberScrapResponse.getStudylogResponse().getId();
studylogScrapService.unregisterScrap(member.getId(), studylogId);
// then
StudylogsResponse studylogsResponse = studylogScrapService.showScrap(member.getId(), Pageable.unpaged());
assertThat(studylogsResponse.getTotalSize()).isEqualTo(0);
}
Aggregations