-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b2f41d
commit 6950a35
Showing
5 changed files
with
80 additions
and
182 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
49 changes: 0 additions & 49 deletions
49
resource-server/src/main/java/com/inhabas/api/domain/contest/dto/UpdateContestBoardDto.java
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
resource-server/src/test/java/com/inhabas/api/domain/contest/dto/ContestBoardDtoTest.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,54 @@ | ||
package com.inhabas.api.domain.contest.dto; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.time.LocalDate; | ||
|
||
import com.inhabas.api.domain.file.dto.FileDownloadDto; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ContestBoardDtoTest { | ||
|
||
@DisplayName("올바른 공모전을 생성하고 검증한다.") | ||
@Test | ||
public void createContestBoardDto() { | ||
|
||
// given | ||
Long id = 1L; | ||
Long contestFieldId = 1L; | ||
String title = "테스트 제목"; | ||
String topic = "테스트 주제"; | ||
String association = "테스트 협회"; | ||
LocalDate dateContestStart = LocalDate.of(2024, 1, 1); | ||
LocalDate dateContestEnd = LocalDate.of(2024, 3, 1); | ||
FileDownloadDto thumbnail = new FileDownloadDto("thumbnail.jpg", "thumbnailUrl"); | ||
|
||
// when | ||
ContestBoardDto contestBoardDto = | ||
ContestBoardDto.builder() | ||
.id(id) | ||
.contestFieldId(contestFieldId) | ||
.title(title) | ||
.topic(topic) | ||
.association(association) | ||
.dateContestStart(dateContestStart) | ||
.dateContestEnd(dateContestEnd) | ||
.thumbnail(thumbnail) | ||
.build(); | ||
|
||
// then | ||
assertThat(contestBoardDto.getId()).isEqualTo(id); | ||
assertThat(contestBoardDto.getContestFieldId()).isEqualTo(contestFieldId); | ||
assertThat(contestBoardDto.getTitle()).isEqualTo(title); | ||
assertThat(contestBoardDto.getTopic()).isEqualTo(topic); | ||
assertThat(contestBoardDto.getAssociation()).isEqualTo(association); | ||
assertThat(contestBoardDto.getDateContestStart()).isEqualTo(dateContestStart); | ||
assertThat(contestBoardDto.getDateContestEnd()).isEqualTo(dateContestEnd); | ||
assertThat(contestBoardDto.getThumbnail()).isEqualTo(thumbnail); | ||
|
||
long expectedDDay = LocalDate.now().until(dateContestEnd, java.time.temporal.ChronoUnit.DAYS); | ||
assertThat(contestBoardDto.getDDay()).as("D-day가 일치하지 않습니다.").isEqualTo(expectedDDay); | ||
} | ||
} |
107 changes: 0 additions & 107 deletions
107
...ce-server/src/test/java/com/inhabas/api/domain/contest/dto/UpdateContestBoardDtoTest.java
This file was deleted.
Oops, something went wrong.
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