-
Notifications
You must be signed in to change notification settings - Fork 330
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단계 - 로또(수동)] 연로그(권시연) 미션 제출합니다. #454
Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6d80ecb
docs: 리드미 갱신 - 요구사항 추가
820a506
refactor: LottoNumbers input 값의 최소한의 검증 View의 책임으로 변경
f7db213
style: 변수명 변경 number -> value
cf4410f
refactor: 인스턴스 캐싱 방식 변경
137b7c2
refactor: 하드코딩 제거, 형식 통일화
3b9694f
style: 우승 상금이 없는 경우 DEFULAT -> NONE 이름 변경
829c37d
test: given, when, then 구분
c71c797
refactor: LottoNumber의 접근제어자 private -> protected 변경
b7a65d2
feat: 수동 로또 개수 클래스 생성
ac8befc
feat: 수동 로또 입력 기능 구현
9f08b0c
feat: 수동 로또 개수 입력 기능 구현
964e57a
refactor: 하드코딩 제거
e45fd9e
style: 오류 문구 수정
7796450
refactor: 수동 구매 시 남은 횟수도 출력되도록 수정
dcd4bcd
docs: 리드미 갱신 - 구현 완료 기능 체크
de191ad
refactor: 티켓에 수동 로또 더하는 경우 LottoTicket 형태로 받도록 개선
3d94fe2
refactor: 정적 팩토리 메소드 도입
2701bcc
test: 테스트 케이스 수정
abb7362
test: given, when, then 분리
ecaba3c
test: findRanking 메소드 테스트 코드 추가
cb8cfb6
style: 1000단위 구분자 표시
4646a00
style: 메소드명 변경
affa474
refactor: equals(), hashCode() 재정의
293fe25
fix: 2등이 아닌데 보너스볼이 포함되는 경우 NONE으로 반환되는 현상 수정
581f834
refactor: findRanking() 메소드 분리
64660e7
style: 사용하지 않는 import 제거
6951fa8
fix: 3위가 반환되지 않는 현상 수정
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -28,10 +28,13 @@ public static Ranking findRanking(int count, boolean hasBonusNumber) { | |||||
} | ||||||
|
||||||
private static boolean checkCountAndBonusNumber(Ranking ranking, int count, boolean hasBonusNumber) { | ||||||
if (count == 5) { | ||||||
if (ranking.count != count) { | ||||||
return false; | ||||||
} | ||||||
if (count == SECOND.getCount()) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
해당 클래스 내의 로직이니 getter를 거치지 않아도 될 것 같아요 :) |
||||||
return ranking.hasBonusNumber == hasBonusNumber; | ||||||
} | ||||||
return ranking.count == count; | ||||||
return true; | ||||||
} | ||||||
|
||||||
public long multiple(Integer count) { | ||||||
|
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.
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.
슬랙에서 테스트 케이스를 하나 제시해주신 크루가 계셔서 로직을 다시 보게 되었어요
2등이 아니더라도 hasBonusNumber가 true로 들어오면 NONE으로 반환되는 현상을 개선했습니다
다만 앞으로도 hasBonusNumber가 true인 값들이 생길때마다 if문 처리해주는건 이상할 것 같아요
그렇다고 BiPredicate를 활용하자니 이미 count가 hasBonusNumber가 상수로 존재하는데 이를 활용하지 못하는게 아닐까? 라는 생각이 드네요
닉이라면 어떤 시도를 해보실 것 같나요?😂
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.
음 그런데 현재 Rank 관련 테스트가 깨지고 있어서, 의도한대로 기능이 동작하지 않고 있어요.
한번 확인해주시고, 2등과 3등의 구분이 문제라면 2등을 ealry return 하는 방법도 한번 생각해보셔요 :)
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.
이 부분 체크를 누락됐네요💦 로직 개선했습니다!