Skip to content

Commit

Permalink
test(#137): 특별전형에서 불합격시 일반전형으로 변경되는 테스트 작성
Browse files Browse the repository at this point in the history
- 특별전형에서 불합격시 일반전형으로 재응시하는 기능을 테스트했어요.
  • Loading branch information
jyj1289 committed Sep 25, 2024
1 parent 09cde53 commit 3015ef1
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.bamdoliro.maru.domain.form.domain.Form;
import com.bamdoliro.maru.domain.form.domain.type.FormStatus;
import com.bamdoliro.maru.domain.form.domain.type.FormType;
import com.bamdoliro.maru.domain.form.service.AssignExaminationNumberService;
import com.bamdoliro.maru.domain.form.service.CalculateFormScoreService;
import com.bamdoliro.maru.domain.user.domain.User;
Expand Down Expand Up @@ -94,7 +95,19 @@ void setUp() {
log.info("score: {}", form.getScore().getTotalScore());
log.info("status: {}", form.getStatus());
});
int passedFormCount = (int)formList.stream().filter(Form::isPassedNow).count();
int passedFormCount = (int) formList.stream().filter(Form::isPassedNow).count();
assertEquals(FixedNumber.TOTAL, passedFormCount);
}

@Test
void 마이스터전형_또는_사회통합전형에서_불합격을_한다면_일반전형으로_다시_지원한다() {
selectSecondPassUseCase.execute();

List<Form> failedFormList = formRepository.findByType(FormType.REGULAR)
.stream()
.filter(form -> form.isFailedNow() || form.isFirstFailedNow())
.toList();

assertEquals((long) formRepository.findAll().size() - FixedNumber.TOTAL, failedFormList.size());
}
}

0 comments on commit 3015ef1

Please sign in to comment.