-
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.
* test: fixture 추가 * test: fixture 인자에 position 추가
- Loading branch information
Showing
6 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
backend/src/test/java/reviewme/fixture/OptionGroupFixture.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,10 @@ | ||
package reviewme.fixture; | ||
|
||
import reviewme.question.domain.OptionGroup; | ||
|
||
public class OptionGroupFixture { | ||
|
||
public OptionGroup 선택지_그룹(long questionId) { | ||
return new OptionGroup(questionId, 1, 2); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
backend/src/test/java/reviewme/fixture/OptionItemFixture.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,15 @@ | ||
package reviewme.fixture; | ||
|
||
import reviewme.question.domain.OptionItem; | ||
import reviewme.question.domain.OptionType; | ||
|
||
public class OptionItemFixture { | ||
|
||
public OptionItem 선택지(long optionGroupId) { | ||
return new OptionItem("선택지 본문", optionGroupId, 1, OptionType.CATEGORY); | ||
} | ||
|
||
public OptionItem 선택지(long optionGroupId, int position) { | ||
return new OptionItem("선택지 본문", optionGroupId, 1, OptionType.CATEGORY); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
backend/src/test/java/reviewme/fixture/QuestionFixture.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,39 @@ | ||
package reviewme.fixture; | ||
|
||
import reviewme.question.domain.Question; | ||
import reviewme.question.domain.QuestionType; | ||
|
||
public class QuestionFixture { | ||
|
||
public Question 선택형_필수_질문() { | ||
return this.선택형_필수_질문(1); | ||
} | ||
|
||
public Question 선택형_필수_질문(int position) { | ||
return new Question(true, QuestionType.CHECKBOX, "본문", null, position); | ||
} | ||
|
||
public Question 선택형_옵션_질문() { | ||
return this.선택형_옵션_질문(1); | ||
} | ||
|
||
public Question 선택형_옵션_질문(int position) { | ||
return new Question(false, QuestionType.CHECKBOX, "본문", null, position); | ||
} | ||
|
||
public Question 서술형_필수_질문() { | ||
return this.서술형_필수_질문(1); | ||
} | ||
|
||
public Question 서술형_필수_질문(int position) { | ||
return new Question(true, QuestionType.TEXT, "본문", null, position); | ||
} | ||
|
||
public Question 서술형_옵션_질문() { | ||
return this.서술형_옵션_질문(1); | ||
} | ||
|
||
public Question 서술형_옵션_질문(int position) { | ||
return new Question(false, QuestionType.TEXT, "본문", null, position); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
backend/src/test/java/reviewme/fixture/ReviewGroupFixture.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,14 @@ | ||
package reviewme.fixture; | ||
|
||
import reviewme.reviewgroup.domain.ReviewGroup; | ||
|
||
public class ReviewGroupFixture { | ||
|
||
public ReviewGroup 리뷰_그룹() { | ||
return this.리뷰_그룹("reviewRequestCode", "groupAccessCode"); | ||
} | ||
|
||
public ReviewGroup 리뷰_그룹(String reviewRequestCode, String groupAccessCode) { | ||
return new ReviewGroup("revieweeName", "projectName", reviewRequestCode, groupAccessCode); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
backend/src/test/java/reviewme/fixture/SectionFixture.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,24 @@ | ||
package reviewme.fixture; | ||
|
||
import java.util.List; | ||
import reviewme.template.domain.Section; | ||
import reviewme.template.domain.VisibleType; | ||
|
||
public class SectionFixture { | ||
|
||
public Section 항상_보이는_섹션(List<Long> questionIds) { | ||
return this.항상_보이는_섹션(questionIds, 1); | ||
} | ||
|
||
public Section 항상_보이는_섹션(List<Long> questionIds, int position) { | ||
return new Section(VisibleType.ALWAYS, questionIds, null, "섹션명", "머릿말", position); | ||
} | ||
|
||
public Section 조건부로_보이는_섹션(List<Long> questionIds, long onSelectedOptionId) { | ||
return this.조건부로_보이는_섹션(questionIds, onSelectedOptionId, 1); | ||
} | ||
|
||
public Section 조건부로_보이는_섹션(List<Long> questionIds, long onSelectedOptionId, int position) { | ||
return new Section(VisibleType.CONDITIONAL, questionIds, onSelectedOptionId, "섹션명", "머릿말", position); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
backend/src/test/java/reviewme/fixture/TemplateFixture.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,11 @@ | ||
package reviewme.fixture; | ||
|
||
import java.util.List; | ||
import reviewme.template.domain.Template; | ||
|
||
public class TemplateFixture { | ||
|
||
public Template 템플릿(List<Long> sectionIds) { | ||
return new Template(sectionIds); | ||
} | ||
} |