Skip to content

Conversation

@pleasebelieveme
Copy link
Owner

@pleasebelieveme pleasebelieveme commented Nov 3, 2025

  • 6개의 로또 번호 저장 및 관리
  • 로또 번호 오름차순 정렬
  • 당첨 번호와 일치 개수 계산
  • 특정 번호 포함 여부 확인
  • 유효성 검증 (null, 개수, 중복, 범위)

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 복권 번호 유효성 검증 및 관리 기능 추가
    • 당첨 번호 검증 및 상금 등급 판정 기능 추가
    • 보너스 번호 처리 기능 지원
  • 문서

    • 도메인 객체 구현 관련 문서 정리 및 중복 제거
  • 테스트

    • 복권 기능 관련 단위 테스트 추가 및 개선

@pleasebelieveme pleasebelieveme merged commit 76e787e into main Nov 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

로또 도메인 구현을 위한 두 개의 새로운 엔티티 클래스(Lotto, WinningLotto)를 추가합니다. Lotto는 6개의 고유한 1-45 범위 숫자의 검증과 저장을 담당하며, WinningLotto는 당첨 번호와 보너스 번호를 관리하고 사용자 로또와의 매칭 결과를 Rank로 반환합니다. 테스트 구조를 재정리합니다.

Changes

Cohort / File(s) 변경 요약
도메인 클래스 추가
src/main/java/lotto/domain/Lotto.java, src/main/java/lotto/domain/WinningLotto.java
Lotto: 6개 고유 정수(1-45 범위) 검증 및 저장, getNumbers(), countMatches(), contains() 메서드 제공. WinningLotto: 당첨 로또와 보너스 번호 관리, match() 메서드로 Rank 반환
문서 업데이트
README.md
Rank 열거형 구현 섹션을 도메인 객체 구현 아래 추가하고 중복된 섹션 제거
로또 테스트 재구성
src/test/java/lotto/domain/LottoTest.java
새로운 테스트 파일 추가: 정상화, 검증, 정렬, 매칭 로직, 엣지 케이스 등 Lotto 클래스 검증
기존 테스트 제거
src/test/java/lotto/LottoTest.java (삭제됨)
이전 루트 경로의 로또 테스트 파일 제거
당첨 로또 테스트
src/test/java/lotto/domain/WinningLottoTest.java
WinningLotto 객체 생성, 다양한 Rank 매칭 결과(FIRST, SECOND, THIRD, FIFTH, NONE), 검증 예외(null, 범위, 중복) 테스트
Rank 테스트 리팩토링
src/test/java/lotto/domain/RankTest.java
7개 테스트 메서드명 단순화: test1MatchSixNumbers() → test1() 등으로 변경

Sequence Diagram

sequenceDiagram
    participant User as 사용자
    participant WinningLotto as WinningLotto
    participant Lotto as Lotto
    participant Rank as Rank
    
    User->>WinningLotto: match(userLotto)
    WinningLotto->>Lotto: countMatches(winningNumbers)
    Lotto-->>WinningLotto: matchCount
    WinningLotto->>Lotto: contains(bonusNumber)
    Lotto-->>WinningLotto: matchBonus (boolean)
    WinningLotto->>Rank: valueOf(matchCount, matchBonus)
    Rank-->>WinningLotto: Rank result
    WinningLotto-->>User: Rank
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • 새로운 도메인 클래스 두 개에서 검증 로직의 정확성 확인 필요
  • 다양한 테스트 케이스 분산(Lotto, WinningLotto, Rank 테스트)으로 여러 파일 검토 필요
  • WinningLotto의 match() 메서드에서 Rank 계산 로직 검증 필요

Possibly related PRs

  • Pleasebelieveme #2: 현재 PR에서 추가된 WinningLotto가 Rank.valueOf() 메서드를 호출하므로, 해당 PR의 Rank 열거형 정의와 직접적인 연관이 있습니다.

Poem

🐰 여섯 개의 숫자를 모아모아,
당첨을 향해 쏘옥 검증하고,
보너스와 만나 Rank가 정해지면,
로또 도메인 완성되는 날이래요! ✨🎰

✨ 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 c9a7eef and 8a33026.

📒 Files selected for processing (7)
  • README.md (1 hunks)
  • src/main/java/lotto/domain/Lotto.java (1 hunks)
  • src/main/java/lotto/domain/WinningLotto.java (1 hunks)
  • src/test/java/lotto/LottoTest.java (0 hunks)
  • src/test/java/lotto/domain/LottoTest.java (1 hunks)
  • src/test/java/lotto/domain/RankTest.java (7 hunks)
  • src/test/java/lotto/domain/WinningLottoTest.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.

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