-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/#223 이벤트 상세 조회 시 상태 잘못 계산하는 오류 수정
- Loading branch information
Showing
2 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...end/emm-sale/src/test/java/com/emmsale/event/application/dto/EventDetailResponseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.emmsale.event.application.dto; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import com.emmsale.event.EventFixture; | ||
import com.emmsale.event.domain.Event; | ||
import com.emmsale.event.domain.EventStatus; | ||
import java.time.LocalDate; | ||
import java.util.Collections; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class EventDetailResponseTest { | ||
|
||
@Test | ||
@DisplayName("이벤트를 상세 조회할 값을 변환할 수 있다.") | ||
void createEventDetailResponseTest() { | ||
//given | ||
final Event 구름톤 = EventFixture.구름톤(); | ||
final LocalDate 날짜 = LocalDate.of(2023, 7, 1); | ||
final EventDetailResponse expected = new EventDetailResponse( | ||
구름톤.getId(), | ||
구름톤.getName(), | ||
구름톤.getInformationUrl(), | ||
구름톤.getStartDate(), | ||
구름톤.getEndDate(), | ||
구름톤.getLocation(), | ||
EventStatus.UPCOMING.getValue(), | ||
Collections.emptyList(), | ||
구름톤.getImageUrl(), | ||
2, | ||
구름톤.getType().toString() | ||
); | ||
|
||
//when | ||
final EventDetailResponse actual = EventDetailResponse.from(구름톤, 날짜); | ||
|
||
//then | ||
assertThat(actual) | ||
.usingRecursiveComparison() | ||
.isEqualTo(expected); | ||
} | ||
} |