Open luke0408 opened 1 year ago
[ 왜 문서인가? ]
DisplayName: Junit 5 부터 나온 어노테이션으로 Test의 이름을 지어줄 수 있음
A이면 B이다. 또는 A이면 B가 아니고 C다.
주문 목록에 담긴다.
메서드 자체의 관점보다 도메인 정책 관점으로
영업 시작 시간
이전에는 주문을 생성할 수 없다.BDD: Behavior Driven Development
테스트케이스(TC)
자체에 집중하여 테스트를 진행@Test
@DisplayName("주문 목록에 담긴 상품들의 총 금액을 계산 할 수 있다.")
void calculateTotalPrice() {
// given
CafeKiosk cafeKiosk = new CafeKiosk();
Americano americano = new Americano();
Latte latte = new Latte();
cafeKiosk.add(americano);
cafeKiosk.add(latte);
// when
int totalPrice = cafeKiosk.calculateTotalPrice();
// then
assertThat(totalPrice).isEqualTo(8500);
}
To-Do: 둘이 비교해보기