Skip to content

Commit

Permalink
test: 무료주문 생성 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
uwoobeat committed Jul 25, 2024
1 parent f7e88f4 commit c3005dd
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,48 @@ private Membership createMembership(Member member, RecruitmentRound recruitmentR
return fixtureHelper.createMembership(member, recruitmentRound);
}

@Nested
class 무료주문_생성할때 {

@Test
void 주문상태는_완료이다() {
// given
Member currentMember = createAssociateMember(1L);
RecruitmentRound recruitmentRound = createRecruitmentRound(
LocalDateTime.now().minusDays(1),
LocalDateTime.now().plusDays(1),
2021,
SemesterType.FIRST,
MONEY_10000_WON);
Membership membership = createMembership(currentMember, recruitmentRound);

// when
Order order = Order.createFree("testNanoId", membership, null);

// then
assertThat(order.getStatus()).isEqualTo(OrderStatus.COMPLETED);
}

@Test
void 최종결제금액은_0원이다() {
// given
Member currentMember = createAssociateMember(1L);
RecruitmentRound recruitmentRound = createRecruitmentRound(
LocalDateTime.now().minusDays(1),
LocalDateTime.now().plusDays(1),
2021,
SemesterType.FIRST,
MONEY_10000_WON);
Membership membership = createMembership(currentMember, recruitmentRound);

// when
Order order = Order.createFree("testNanoId", membership, null);

// then
assertThat(order.getMoneyInfo().getFinalPaymentAmount()).isEqualTo(Money.ZERO);
}
}

@Nested
class 주문_취소할때 {

Expand Down

0 comments on commit c3005dd

Please sign in to comment.