로또 완성!!!#2105
Open
Suxxxxhyun wants to merge 7 commits into
Open
Conversation
JHyun0302
reviewed
Dec 2, 2023
| List<Integer> winningNumbers = InputView.inputWinngingNumbers(); | ||
| return createWinngingNumbers(winningNumbers); | ||
| } catch (IllegalArgumentException e){ | ||
| OutputView.printMessage(e.getMessage()); |
There was a problem hiding this comment.
OutputView도 "private final OutputView outputView" 이렇게 선언해주는게 어떨까요?
Author
There was a problem hiding this comment.
음..!! 그렇게 선언하면 좋은 점이 어떤것인가요!!
| public void start(final PurchaseAmount purchaseAmount){ | ||
| public Lottos start(final PurchaseAmount purchaseAmount){ | ||
| Lottos purchaseLottos = generateLottos(purchaseAmount); | ||
| lottos = purchaseLottos; |
There was a problem hiding this comment.
21, 22번 라인을 이렇게 줄일 수 있을거 같아요!
lottos = generateLottos(purchaseAmount);
| } | ||
|
|
||
| public List<Lotto> getLottos(){ | ||
| return lottos; |
There was a problem hiding this comment.
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.
Collections.unmodifiableMap(winningResult);
Map은 이런 방법으로 불변을 정해 줄 수 있어요 👍
| return new WinningResultDto(winningResult); | ||
| } | ||
|
|
||
| public String formatRateOfReturn(){ |
| import static util.message.ExceptionMessage.*; | ||
|
|
||
| public class Validator { | ||
| protected static void validateBlank(final String input) { |
There was a problem hiding this comment.
protected를 사용해서 validator 패키지 내부에서만 사용했군요!! 👍
| public class BonusValidatorTest { | ||
|
|
||
| @ParameterizedTest | ||
| @DisplayName("보너스번호를 ") |
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.
No description provided.