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.
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
[2단계 - 블랙잭(베팅)] 테오(최우성) 미션 제출합니다. #527
[2단계 - 블랙잭(베팅)] 테오(최우성) 미션 제출합니다. #527
Changes from 28 commits
917f950
fb46c3c
d88b82f
a5e4170
4d74e40
7bafa7e
aad2642
e850be5
cce418b
ffbcd20
baadb43
2b3c1a8
7e74cd6
58af9fb
b84edd1
049716f
8c99d4b
3bf36e2
f4fdd0c
e4c38d0
7f1c46e
0c743ae
67ad274
33776c2
741daf0
4d0b87d
2b03754
c883c86
54d484b
7ed05fa
d7f9fcb
5bb69e0
17e3295
6339186
b1d6097
fbbfc9c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
자명한 라이브러리 이외의 로직이 추가되었으니 테스트가 필요해보입니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 내부적으로 로직이 추가되었기는 하나, 단순히 생성 흐름이라 판단해서
테스트할 것이 없다고 생각했었습니다. 또한 무엇을 테스트해야 할지도 명확하지가 않다고 생각했어요.
고민해보았는데, 말씀해주신 부분에 대해 아직 제가 감을 잘 못잡는 것 같습니다 😅
혹시 조금만 더 짚어주실 수 있을까요!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존엔
Collections.shuffle(shuffledCards)
로만 구성된 메서드였지만,현재는 새로운 리스트를 생성해서 반환하는 테오만의 로직이 추가되었으니 이 부분에 대한 테스트가 필요하지 않을까요? 라는 리뷰였습니다. 예를들어 입력한 리스트와 반환된 리스트가 동일한 레퍼런스를 갖지 않는 테스트가 존재할 수 있겠네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이전에 드렸던 리뷰에 공감되서 옮기신 거라면 플레이어의 이름 검증 부분이 추가되어야하지 않을까요? 그렇게되면 이 상수는 어디에 위치하는게 적절할까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고민해 본 결과,
터틀이 말씀해주신 의도가
예약어이기 때문에 플레이어가 이를 사용할 수 없게 해야 한다
임을 알았습니다. (맞겠죠..?!)즉, 플레이어 이름을 향한 검증 로직이 '딜러'라는 예약어와 함께 존재해야 하고,
결국 '딜러'라는 리터럴은
PlayerName
객체에 존재해야 한다라는 결론에 도달했습니다.하지만 '딜러'라는 이름이 PlayerName 객체에 존재하게 되면 Dealer는 더 이상 생성자를 통해 이름을 초기화할 수 없습니다.
따라서 protected 생성자를 정의하고, Dealer가 호출 가능하게 정의했습니다.
이 과정에서 PlayerName까지 생성자가 추가되었는데, 이런 접근방식은 처음이라 좋은 설계인지 궁금합니다!
그리고, 리터럴 상수로 "딜러"만 정의해두고 검증에서 이를 사용하는 것은 확장에 닫혀있다 생각하여 enum 객체로 분리하였는데 이것도 괜찮은 방법이었는지 궁금해요 🙇♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
많은 고민을 해주셨군요 👍🏻
간단히
PlayerName
을GameParticipantName
로 바꾸면 구현이 가능하지 않을까요? 🙂