-
Notifications
You must be signed in to change notification settings - Fork 191
[로또] 이준필 미션 제출합니다. #171
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
Open
junepil
wants to merge
33
commits into
woowacourse-precourse:main
Choose a base branch
from
junepil:junepil
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[로또] 이준필 미션 제출합니다. #171
Conversation
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
- When generating `Lotto` instance, it validates the input by it's own. - `Lotto` class saves the numbers in ascending order . - Using private field for numbers and add getter for data fetch.
This class is for centralized validation. It is desinged to be used for various kinds of data. Currently it supports the following validation for the data. - if data is only constitued with integer - if every data has a unique value - if the data satisfies certain length - if every data is in certain range
Update the validation code inside the `Lotto.js` to use the centralized validator class.
Add `CustomError.js` to generate consistant errors.
Now it can validate if the data only consist with specific class of subclasses of that class.
This class is for generating lotto instances. It gives lottos according to the amount of input.
LottoStatistician can generate statistic with a given numbers and lottos.
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.
로또 추첨기 구현
사용자가 구매 금액을 입력하면 로또를 발행하고, 당첨 번호와 보너스 번호를 입력받아 당첨 통계와 수익률을 계산하는 애플리케이션입니다.
주요 기능
[ERROR]메시지 출력 후 재입력 요구구현 특징
아키텍처 설계
핵심 클래스
Lotto: 로또 번호 6개를 관리하는 도메인 객체LottoVender: 로또 발행을 담당하는 정적 클래스LottoStatistician: 당첨 통계 계산을 담당하는 클래스Validator: 입력값 검증을 위한 체이닝 방식의 유틸리티 클래스CliLottoView: 콘솔 입출력을 담당하는 뷰 클래스검증 시스템
체이닝 방식의
Validator클래스로 다양한 검증 로직을 재사용 가능하게 구현:에러 처리
CustomError→ 각 도메인별 에러)[ERROR]접두사 자동 추가테스트 전략
ApplicationTest.js에서 전체 플로우 검증Random,Console) 모킹으로 테스트 안정성 확보코드 품질
파일 구조