Skip to content

Conversation

@ParkSeongGeun
Copy link
Collaborator

📌 관련 이슈 번호


📘 작업 유형

  • 테스트

📙 작업 내역 (구현 내용 및 작업 내역을 기재합니다.)

  • ViewModel의 테스트 코드를 구현했습니다.

📝 특이 사항 (Optional)

Copy link
Member

@Hansangjin98 Hansangjin98 left a comment

Choose a reason for hiding this comment

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

전체적으로 비즈니스 로직을 테스트하기 보다 Call Count만 체크를 하고 있어서 다시 검토가 필요할 것 같습니다!

Comment on lines +12 to +15
final class MockDiaryUseCase: DiaryUseCase {
var diaryRepository: DiaryRepository {
fatalError("Not implemented")
}
Copy link
Member

Choose a reason for hiding this comment

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

  1. DiaryUseCase에서는 diaryRepository의 함수를 호출하는 로직이 대부분인데 diaryRepository에 접근하면 fatalError를 발생시키는 이유가 있나요? diaryRepository를 주입받거나 호출하는 부분 또한 보이지 않네요

  2. 실제로 사용되는 DiaryUseCase 구현체에서는 내부에 복잡한 비즈니스 로직들이 존재하는데 해당 비즈니스 로직은 테스트하지 않아도 되나요? 단순 CallCount만 체크하면 되는 로직이 아닌 것 같다는 생각이 듭니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📐 Test 테스트

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants