Open
Conversation
- Application -> main 메서드에서 InputView·OutputView·FileReader 생성 및 Controller 실행 흐름 구현 - Controller -> 생성 및 InputView/OutputView/FileReader 의존성 주입 - RetryExecutor -> 잘못된 입력 시 재입력하는 RetryExecutor 클래스 추가 - Message -> default method format(), prependNewLineToMessage(), appendNewLineToMessage()를 가진 Message 인터페이스 추가 - DeveloperErrorMessage -> 개발자용 에러 메시지인 DeveloperErrorMessage enum 클래스 추가 - DomainErrorMessage -> 도메인용 에러 메시지인 DomainErrorMessage enum 클래스 추가 - InputMessage, OutputMessage -> 입출력 안내문 메시지인 enum 클래스 추가 - ParserErrorMessage -> 파싱할 때 발생하는 에러 메시지인 enum 클래스 추가 - InputParser -> 사용자 입력값 혹은 문자열을 받아 구분자로 파싱하는 클래스 추가
- 500원 단위가 아닐 경우 - 500원 ~ 20,000원 사이가 아닐 경우
…클래스 추가 - 로또 가격 500 - 로또 구입 최대 금액 20,000 - 로또 개수 5개 - 로또 최소 번호 1 - 로또 최대 번호 5
- 정적 팩토리 메서드 사용 - 객체 생성 시 validate() 검증 - 구입금액이 500원 단위인지 validateMultipleOfLottoPrice() - 구입금액이 최소 500원에서 최대 20,000원을 초과했는지 validateOutOfBoundsPurchaseAmount()
- RetryExecutor를 활용하여 사용자 입력값 에러 시 재입력
- 구입금액을 통해 몇 개를 샀는지 구하는 메서드
- 객체 생성 성공/실패 테스트 - 객체 생성 후 티켓 개수 반환하는 파생 행위 테스트
…tor 추가 - 로또 번호 생성 방식을 추상화하기 위한 인터페이스 정의 - generate() 메서드를 통해 List<Integer> 형태의 번호 리스트 생성 책임 부여 - 이후 구현체에서 구체적 랜덤 로직을 담당할 예정
…MissionUtilsPlanetLottoNumberGenerator 추가 - 로또 번호 무작위 생성 로직인 missionutils.Randoms.pickUniqueNumbersInRange() 사용 - stream()을 통해 오름차순 정렬 및 List 반환
- 로또 생성 전략을 통해 로또 발행 - 티켓 수만큼 로또 발행
- LottoMachine을 통해 발행한 로또 티켓들을 관리
- 티켓 수 구함 > 로또 머신을 통해 티켓 수만큼 로또 발행 > 티켓 수와 발행한 로또 티켓들 출력
- 로또 규칙 validate 검증 (1~30, 중복X, 5개)
- 당첨 번호와 중복인지 검증 - 로또 범위에 맞는지 검증
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.
행성 로또
📁 패키지 구조