[Test] DTO CodingKey와 FirestoreFieldKey 간 매핑 일치 여부 테스트 코드 작성 #53
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



#️⃣ 연관된 이슈
📝 작업 내용
DTO CodingKey와 FirestoreFieldKey 간 매핑 일치 여부 테스트 코드를 작성하였습니다.
이 과정에서 여러 모듈의 테스트 코드에서 재사용 가능한 코드를 위해 TestSupport라는 이름의 모듈을 구현했습니다.
🎨 스크린샷
💬 추가 설명
1. 작업 의미
이 작업의 의미는 개발자의 실수로 CodingKey 케이스 값을 변경하거나, Firestore의 FieldKey 값을 변경하면서 발생할 수 있는 매핑 불일치를 대응하기 위함입니다.
다만, 테스트 코드를 실행해야만 일치 여부를 확인할 수 있다는 점, 즉 개발자가 디버깅 환경에서 빌드하는 과정에서는 일치 여부를 확인할 수 없다는 점이 완벽한 대응책은 아니라고 느껴지긴 합니다.
2. TestSupport 모듈 구현
류성두님이 뱅크샐러드 블로그 글을 참고하였습니다.
이를 참고하여 given, when, then의 메서드를 제공하는 BaseTestCase 프로토콜을 구현하였습니다.
이는 모든 테스트코드들이 각 단계별 작업을 더 명확히 나눠질 수 있도록 하면서 가독성을 높이기 위함입니다.
실제 사용 예시는 아래와 같습니다.