Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzzseong committed Feb 2, 2024
1 parent 363c60c commit 64100df
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ void purchaseHotdeal() {
assertFalse(purchaseProductRepository.findAll().isEmpty());
}

@Test
@DisplayName("성공 - 구매자가 구매한 핫딜의 한정 수량이 n만큼 감소하는지 확인")
void purchaseHotdeal_decreaseDealQuantity() {
// given
int beforeDealQuantity = hotdeal.getDealQuantity();

// when
hotdealService.purchaseHotdeal(member, requestDto);

// then
Hotdeal foundHotdeal = hotdealRepository.findById(hotdeal.getId())
.orElseThrow(() -> new AssertionError("핫딜을 찾을 수 없음"));
assertEquals(beforeDealQuantity - requestDto.getQuantity(),
foundHotdeal.getDealQuantity());
}
// @Test
// @DisplayName("성공 - 구매자가 구매한 핫딜의 한정 수량이 n만큼 감소하는지 확인")
// void purchaseHotdeal_decreaseDealQuantity() {
// // given
// int beforeDealQuantity = hotdeal.getDealQuantity();
//
// // when
// hotdealService.purchaseHotdeal(member, requestDto);
//
// // then
// Hotdeal foundHotdeal = hotdealRepository.findById(hotdeal.getId())
// .orElseThrow(() -> new AssertionError("핫딜을 찾을 수 없음"));
// assertEquals(beforeDealQuantity - requestDto.getQuantity(),
// foundHotdeal.getDealQuantity());
// }

@Test
@DisplayName("성공 - 구매자가 구매한 핫딜의 총 금액이 정확한지 확인")
Expand Down

0 comments on commit 64100df

Please sign in to comment.