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

[Feat] 테스트 코드 작성 #222

Open
2 tasks
chaewon12 opened this issue Dec 26, 2023 · 1 comment
Open
2 tasks

[Feat] 테스트 코드 작성 #222

chaewon12 opened this issue Dec 26, 2023 · 1 comment
Assignees
Labels
✨ Feature 새 기능 ✅ Test 테스트

Comments

@chaewon12
Copy link
Member

🔨개발 할 기능

CI 활용성 및 테스트 커버리지 측정을 위한 테스트 코드 작성

🧩 세부 기능

  • 각자 구현한 API에 대한 테스트 코드 작성
  • Repository / Service / Controller에 대한 테스트 코드를 작성하여 pr

📖 참고 사항

한 번에 모든 API에 대한 테스트 코드를 올리지 말고 적당히 도메인 별로 나눠서 작업 후 pr
pr이 쌓이면서 변하는 테스트 커버리지를 보기 위함!

@chaewon12
Copy link
Member Author

chaewon12 commented Dec 26, 2023

Test Code 컨벤션

  • 메소드 이름을 [기대결과_테스트상태] 방식으로 작성
  • @DisplayName 형식은 given-when-then 으로 작성한다
  • 메소드 내에 주석으로 given-when-then을 구분한다

예시)

@Nested
@DisplayName("Order 단위 테스트")
class OrderTest {

	@Test
	@DisplayName("오더를 생성한다")
	public void createOrder() {
		// when & then
	}

	@Test
	@DisplayName("아이디가 없으면 오더를 생성할 때 예외가 발생한다")
	public void throwException_nullId() {
		// given
		// when
		// then
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 새 기능 ✅ Test 테스트
Projects
None yet
Development

No branches or pull requests

3 participants