Open
Conversation
- presenter, domain 테스트 코드 추가
- 2가지 RecyclerView 생성 모듈 적용
handnew04
approved these changes
Apr 7, 2020
| } | ||
|
|
||
| @Test | ||
| fun `이미지 간격을 제외한 디바이스 가로 길이에 맞춰 2 대 3 비율로 이미지 사이즈 결정`() { |
Collaborator
There was a problem hiding this comment.
궁금해서 질문 남깁니다 ㅎㅎㅎ...! fun '~~~' () 이렇게 써도 실행이 되는건가요? 테스트라는 어노테이션이 붙어서 가능한걸까요..? 테스트는 정말 아무것도 몰라서 궁급합니답..!
Collaborator
There was a problem hiding this comment.
백틱 이라는 것을 알아보시면 될 것 같습니다 ㅎㅎ
일반 함수작성할 때도 가능하고 보통은 예약어와 겹칠때 사용하거나, 위와 같은 식으로 테스트에서 활용됩니다
Collaborator
Author
There was a problem hiding this comment.
저도 백틱 이라는것 처음 들어보았습니다. 감사합니다. ㅎㅎ
저도 회사에서 테스트코드를 사용하지는 않지만 종종 테스트 예제에서 위와 같이 쓰는게 있어서 이렇게 사용해 보았습니다.
| gson.fromJson(errorBody.string(), ErrorResponse::class.java) | ||
| } ?: ErrorResponse(listOf(unknownError)) | ||
| } catch (exception: Exception) { | ||
| ErrorResponse(listOf(unknownError)) |
Collaborator
There was a problem hiding this comment.
너무 초보적인 질문일거 같아서 우선 죄송합니다. ErrorResponse 파일을 보니 string list 하나가 있더라구요. 만드신 의도가 궁금합니다..! 저한테는 생소한 부분이여서요!
Collaborator
Author
There was a problem hiding this comment.
Movie API 에서 에러를 list 형식으로 보내주더라구요!
저도 리스트로 안만들어서 사용하는데 현재 사용하고 있는 Movie API가 이렇게 보내줘서 만들었습니다. :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
자세한 설명은 readme를 참고해 주세요.