Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

동걸 TC 정의 #27

Closed
wants to merge 15 commits into from
Closed

동걸 TC 정의 #27

wants to merge 15 commits into from

Conversation

e-build
Copy link
Contributor

@e-build e-build commented Sep 20, 2023

📌 요약

  • 전반적인 요구사항에 대해서 tc 추가했습니다
  • 상세한 엣지 케이스 검증하다고 생각되는 부분은 구체적인 상황부여와 함께 tc 작성했습니다. ex) 주문 생성 - 동시 요청 시 재고 검증
  • 패키지는 도메인별로 구분했고, 도메인 내 패키지 구조는 레이어드 아키텍처에서 요구하는 presentation - application - domain - intra 로 가정하고 TC 도 테스트 소스의 동일한 패키지에 배치했습니다.

📕 무엇을 작업하셨나요?

  • 버그 수정
  • 기능 개발
  • 리팩터링
  • 테스트
  • 빌드 및 환경설정 관련 작업
  • 그 외의 경우 간략히 기술해주세요

📖 변경사항

✅ 체크리스트

  • 환경변수를 임의로 수정하지 않았나요?
  • 불필요한 로그를 지우셨나요?

@e-build e-build requested a review from sm9171 September 20, 2023 00:40
@e-build e-build self-assigned this Sep 20, 2023
@e-build e-build changed the title Feature/donggeol 동걸 TC 정의 Sep 20, 2023
@github-actions
Copy link

github-actions bot commented Sep 20, 2023

Test Results

36 tests   36 ✔️  2s ⏱️
28 suites    0 💤
28 files      0

Results for commit 9955c27.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

📝 테스트 커버리지 리포트입니다

Overall Project 0% -56.25% 🔴
Files changed 0% 🔴

File Coverage
OrderCancelService.kt 0% 🔴
CartItemCreateService.kt 0% 🔴
CartItemUpdateService.kt 0% 🔴
OrderPlaceService.kt 0% 🔴
ItemCreateService.kt 0% 🔴
ItemSearchService.kt 0% 🔴
PaymentCancelService.kt 0% 🔴
PaymentService.kt 0% 🔴
StoreCreateService.kt 0% 🔴

@github-actions
Copy link

📝 테스트 커버리지 리포트입니다

Overall Project 0% -61.11% 🔴
Files changed 0% 🔴

File Coverage
OrderCancelService.kt 0% 🔴
CartItemUpdateService.kt 0% 🔴
OrderPlaceService.kt 0% 🔴
CartItemCreateService.kt 0% 🔴
OrderCreateService.kt 0% 🔴
ItemCreateService.kt 0% 🔴
ItemUpdateService.kt 0% 🔴
ItemSearchService.kt 0% 🔴
PaymentService.kt 0% 🔴
PaymentCancelService.kt 0% 🔴
StoreCreateService.kt 0% 🔴

Comment on lines +16 to +19
@Test
@DisplayName("`Then: 주문이 '결제 대기' 혹은 '발송 대기' 상태가 아니면, IllegalStateException 발생한다.`")
fun tc1() {
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주문의 결제 상태에 따라 각각의 테스트 케이스가 있는 것도 괜찮은 것 같습니다. (결제 대기, 발송 대기, 발송 시작, 발송 취소)


@Nested
@DisplayName("When: 상품 등록 요청 시, ")
internal inner class when_store_create_request_is_received {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상품명이 빈값이면 예외처리도 추가하면 좋을 것 같습니다.

internal inner class when_store_create_is_completed {

@Test
@DisplayName("Then: 상품은 '판매 대기' 혹은 '판매중' 상태이다.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상품을 등록하고 나서 상태가 바로 판매 대기가 될지 판매중이 될지 팀끼리 의논해서 결정하여 테스트 진행하면 좋을 것 같습니다.


@Nested
@DisplayName("When: 조건을 전달할 시, ")
internal inner class when_condition_is_provided {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

검색어의 최대 길이 제한 케이스도 생각 해 볼 수 있을것 같아요

class CartItemRegisterServiceTest {

@Nested
@DisplayName("When: A, B 판매자의 상품의 재고가 각각 5개일 떄,")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A,B 판매자의 상품의 재고가 0인 케이스도 생각해보면 좋을 것 같습니다

@sm9171
Copy link
Collaborator

sm9171 commented Sep 20, 2023

안녕하세요 동걸님. 짧은 기간내에 테스트 케이스를 상세하게 주셔서 깜짝 놀랐습니다. 수고 많으셨습니다.

도메인에서 기능별로 클래스를 나누어 셔서 저는 도메인 별로 구성된 테스트 케이스를 이해하는데 편했습니다. 테스트 클래스 안에 inner class를 사용하여 같은 조건에서의 여러개의 테스트를 구현한것도 저는 좋다고 생각합니다.

제가 딱히 수정 드릴 부분은 없고 테스트 케이스에서 몇 가지 추가되었으면 좋겠다 하는 부분에 대해 커멘트 달았습니다. 그리고 제 개인적인 생각으로는 동걸님이 만들어 주신 테스트 케이스에서 추가적으로 추가할 부분 추가하거나 수정하는 식으로 진행하면 될 것 같습니다.

@e-build e-build closed this Oct 1, 2023
@e-build e-build deleted the feature/donggeol branch October 1, 2023 01:03
@e-build e-build restored the feature/donggeol branch October 1, 2023 01:04
@e-build e-build deleted the feature/donggeol branch October 9, 2023 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants