Skip to content

Commit

Permalink
test: [#6] ReservationDateTest 생성
Browse files Browse the repository at this point in the history
1. createReservationDateWhichIsNotBetweenOneAndThirtyOne()
- validateReservationDate()
 1 ~ 31일 사이의 날짜가 아니면 IllegalArgumentException 발생시키는지 테스트
  • Loading branch information
MeanOfRedStone committed Nov 25, 2023
1 parent 92697d9 commit 92d18e0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/java/christmas/ReservationDateTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package christmas;

import christmas.domain.ReservationDate;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;

public class ReservationDateTest {
@DisplayName("예약 날짜가 12월(1~31일)에 해당하지 않으면 예외발생")
@Test
void createReservationDateWhichIsNotBetweenOneAndThirtyOne() {
assertThatThrownBy(() -> new ReservationDate(0))
.isInstanceOf(IllegalArgumentException.class);

assertThatThrownBy(() -> new ReservationDate(32))
.isInstanceOf(IllegalArgumentException.class);
}
}

0 comments on commit 92d18e0

Please sign in to comment.