-
Notifications
You must be signed in to change notification settings - Fork 2k
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
로또 완성!!! #2105
base: main
Are you sure you want to change the base?
로또 완성!!! #2105
Conversation
List<Integer> winningNumbers = InputView.inputWinngingNumbers(); | ||
return createWinngingNumbers(winningNumbers); | ||
} catch (IllegalArgumentException e){ | ||
OutputView.printMessage(e.getMessage()); |
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.
OutputView도 "private final OutputView outputView" 이렇게 선언해주는게 어떨까요?
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.
음..!! 그렇게 선언하면 좋은 점이 어떤것인가요!!
Lottos purchaseLottos = generateLottos(purchaseAmount); | ||
lottos = purchaseLottos; |
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.
21, 22번 라인을 이렇게 줄일 수 있을거 같아요!
lottos = generateLottos(purchaseAmount);
} | ||
|
||
public List<Lotto> getLottos(){ | ||
return lottos; |
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.unmodifiableList(lottos);
이렇게 사용하면 외부에서 변경하지 못하도록 만들 수 있어요! 👍
참고 : https://tecoble.techcourse.co.kr/post/2020-04-28-ask-instead-of-getter/
} | ||
|
||
public HashMap<Rank, Integer> getWinningResult(){ | ||
return winningResult; |
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.unmodifiableMap(winningResult);
Map은 이런 방법으로 불변을 정해 줄 수 있어요 👍
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.
오..!! 감사합니다!!
return new WinningResultDto(winningResult); | ||
} | ||
|
||
public String formatRateOfReturn(){ |
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.
dto에서 계산해서 format을 만들다니.. 한 수 배웁니다!
import static util.message.ExceptionMessage.*; | ||
|
||
public class Validator { | ||
protected static void validateBlank(final String input) { |
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.
protected를 사용해서 validator 패키지 내부에서만 사용했군요!! 👍
public class BonusValidatorTest { | ||
|
||
@ParameterizedTest | ||
@DisplayName("보너스번호를 ") |
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.
오타 발견!! :)
No description provided.