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

Domain 모듈 SuspendCatching 테스트 코드 추가 #140

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

easyhooon
Copy link
Collaborator

  • kotest 라이브러리 의존성 추가
  • kotest convention plugin 추가
  • runSuspendingCatching 함수에 대한 테스트 코드 작성

runSuspendCatching 함수에 대한 테스트 코드 작성

정상적으로 테스트가 통과되는 것을 확인
@easyhooon easyhooon self-assigned this Oct 24, 2023
@easyhooon easyhooon added gradle tasks related to gradle setup test-coding tasks related to writing or updating test code, scripts, or test cases. labels Oct 24, 2023
Copy link
Collaborator

@likppi10 likppi10 left a comment

Choose a reason for hiding this comment

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

뭔가 서비스에는 안 보이는 코드들이 붙어가는 느낌이구먼 :D

@@ -0,0 +1,26 @@
package com.nexters.bandalart.android.core.domain
Copy link
Collaborator

Choose a reason for hiding this comment

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

테스트는 경험이 없어서 그런데, 이렇게 코드를 작성해놓으면 어떻게 확인해 볼 수 있는거야?

Copy link
Collaborator Author

@easyhooon easyhooon Oct 24, 2023

Choose a reason for hiding this comment

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

테스트는 경험이 없어서 그런데, 이렇게 코드를 작성해놓으면 어떻게 확인해 볼 수 있는거야?

image 이런식으로 프로젝트로 내에서 해당 파일을 확인해보면 왼쪽에 각 태스크 별로 실행해볼 수 있는 실행 아이콘(녹생 진행버튼)이 생겨서 눌르면 테스트가 정상적으로 통과하는지 실패하는지 확인할 수 있구,

class 옆에 있는 실행 아이콘을 누르면 해당 클래스내에 모든 태스크를 한번에 실행할 수 있고, 아래 추가한 unit-test.run(style check 할때 처럼 할 수 있는) 으로 실행하면 프로젝트 내에 전체 유닛 테스트를 한번에 실행할 수 있어

image

참고로 Plugins marketplace 가서 kotest plugin 을 깔아야 태스크 별로 개별로 실행할 수 있는 실행 아이콘이 생성이 되는 것 같드라구.. 이건 JUnit 에 비해 테스트 코드 자체는 가독성이 엄청 좋은거 같은데 사전에 세팅해야 할게 좀 많아서 번거로운 단점이 있는 것 같아

@easyhooon easyhooon merged commit 3a4c1d8 into develop Oct 24, 2023
1 check passed
@easyhooon easyhooon deleted the feature/domain-test-code branch October 24, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gradle tasks related to gradle setup test-coding tasks related to writing or updating test code, scripts, or test cases.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants