Search in sources :

Example 1 with MemberScrapResponse

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());
}
Also used : MemberScrapResponse(wooteco.prolog.member.application.dto.MemberScrapResponse) MemberResponse(wooteco.prolog.member.application.dto.MemberResponse) StudylogResponse(wooteco.prolog.studylog.application.dto.StudylogResponse) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) IntegrationTest(wooteco.support.utils.IntegrationTest) DisplayName(org.junit.jupiter.api.DisplayName)

Example 2 with MemberScrapResponse

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);
}
Also used : MemberScrapResponse(wooteco.prolog.member.application.dto.MemberScrapResponse) StudylogsResponse(wooteco.prolog.studylog.application.dto.StudylogsResponse) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) IntegrationTest(wooteco.support.utils.IntegrationTest) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

DisplayName (org.junit.jupiter.api.DisplayName)2 Test (org.junit.jupiter.api.Test)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 MemberScrapResponse (wooteco.prolog.member.application.dto.MemberScrapResponse)2 IntegrationTest (wooteco.support.utils.IntegrationTest)2 MemberResponse (wooteco.prolog.member.application.dto.MemberResponse)1 StudylogResponse (wooteco.prolog.studylog.application.dto.StudylogResponse)1 StudylogsResponse (wooteco.prolog.studylog.application.dto.StudylogsResponse)1