Skip to content

Conversation

@pleasebelieveme
Copy link
Owner

@pleasebelieveme pleasebelieveme commented Nov 3, 2025

  • LottoGenerator.java를 구현하여 구입 금액에 비례하여 로또 티켓 리스트를 생성.
  • Randoms.pickUniqueNumbersInRange를 사용하여 중복 없는 1~45 사이의 6개 번호 생성 로직 구현.

Summary by CodeRabbit

릴리스 노트

  • 신규 기능

    • 로또 티켓 생성 기능 추가: 구매 금액을 기반으로 여러 장의 로또 티켓을 자동으로 생성합니다.
  • API 변경

    • 로또 설정 상수 공개: 로또 번호 개수 및 최소/최대 번호 관련 상수가 외부에서 접근 가능하도록 변경되었습니다.

@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

로또 도메인 클래스의 세 상수(LOTTO_NUMBER_COUNT, MIN_LOTTO_NUMBER, MAX_LOTTO_NUMBER)를 private에서 public으로 변경하여 공개 API로 노출하고, 구입 금액을 기반으로 로또 티켓을 생성하는 LottoGenerator 유틸리티 클래스를 추가했으며, 이에 대한 테스트를 작성했습니다.

Changes

Cohort / File(s) Summary
상수 가시성 변경
src/main/java/lotto/domain/Lotto.java
LOTTO_NUMBER_COUNT, MIN_LOTTO_NUMBER, MAX_LOTTO_NUMBER를 private static final에서 public static final로 변경하여 외부 접근 가능하도록 노출
로또 생성기 구현
src/main/java/lotto/util/LottoGenerator.java
구입 금액을 입력받아 해당 수량만큼의 로또 티켓을 생성하는 LottoGenerator 유틸리티 클래스 추가. generateLottos() 메서드와 generateOneLotto() 헬퍼 메서드 포함
로또 생성기 테스트
src/test/java/lotto/util/LottoGeneratorTest.java
다양한 구입 금액에 대해 올바른 수의 로또가 생성되는지, 각 로또의 숫자들이 범위 내에 있고 중복 없이 정렬되어 있는지 검증하는 테스트 추가

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • 로또 상수의 가시성 변경은 간단한 수정이지만, 공개 API 변경이므로 의도 확인 필요
  • LottoGenerator의 번호 생성 로직과 Randoms 유틸리티와의 상호작용 검토 필요
  • 테스트의 parameterized 테스트 구성 및 assertion 검증

Possibly related PRs

  • feat(domain): Lotto 객체 기본 기능 구현 #3: 동일한 Lotto 클래스 상수들(LOTTO_NUMBER_COUNT, MIN_LOTTO_NUMBER, MAX_LOTTO_NUMBER)의 가시성을 수정하는 PR으로, 현재 PR에서 사용되는 같은 상수들을 직접 수정합니다.

Poem

🐰 매직 숫자 세 개가 빛을 보네,
공개 무대로 나온 로또 상수들,
생성기가 뽑고 테스트가 검증하고,
행운의 번호들이 줄을 서 있네!
당신의 복권 꿈, 이제 현실이 되는 날! ✨🎰

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pleasebelieveme

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8541c2 and 6e16065.

📒 Files selected for processing (3)
  • src/main/java/lotto/domain/Lotto.java (1 hunks)
  • src/main/java/lotto/util/LottoGenerator.java (1 hunks)
  • src/test/java/lotto/util/LottoGeneratorTest.java (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pleasebelieveme pleasebelieveme merged commit 849674d into main Nov 3, 2025
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants