Skip to content
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

step3: 로또(2등) 구현 #948

Open
wants to merge 13 commits into
base: kdh85
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
step3: 로또(2등) 로또 코드컨밴션 수정
* lint 미적용대상 반영.
kdh85 committed Nov 15, 2023
commit f0f3a9aee90e2a612ec8b532c4d4edfb2e556994
4 changes: 2 additions & 2 deletions src/main/kotlin/lotto/domain/WinningLotto.kt
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@ class WinningLotto(
) {
init {
require(!winningLotto.lottoNumbers.contains(bonusNumber)) {
"로또 번호와 보너스번호는 중복이 될 수 없습니다. 중복된 번호 ${bonusNumber}"
"로또 번호와 보너스번호는 중복이 될 수 없습니다. 중복된 번호 : $bonusNumber"
}
}

fun matchByRank(bundle: LottoBundle): List<Rank> {
return bundle.findAllByMatchRanks(this)
}
}
}
4 changes: 2 additions & 2 deletions src/test/kotlin/lotto/domain/LottoBundleTest.kt
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ class LottoBundleTest {
}

@Test
fun `랭크별 수량을 집계한다`(){
fun `랭크별 수량을 집계한다`() {
// Given
val caseOfNumbers = listOf(
Numbers(listOf(1, 2, 3, 4, 5, 6)),
@@ -77,4 +77,4 @@ class LottoBundleTest {
)
assertThat(actual).isEqualTo(expected)
}
}
}
6 changes: 3 additions & 3 deletions src/test/kotlin/lotto/domain/LottoRecordsTest.kt
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ class LottoRecordsTest {
LottoRecord(Rank.FOURTH_RANK, 0),
LottoRecord(Rank.THIRD_RANK, 0),
LottoRecord(Rank.SECOND_RANK, 1),
LottoRecord(Rank.SECOND_BONUS_RANK, 2),
LottoRecord(Rank.SECOND_BONUS_RANK, 2),
LottoRecord(Rank.FIRST_RANK, 1),
LottoRecord(Rank.NONE_RANK, 3),
)
@@ -48,7 +48,7 @@ class LottoRecordsTest {
}

@Test
fun `총수익률을 반환한다`(){
fun `총수익률을 반환한다`() {
val givenRecords = setOf(
LottoRecord(Rank.FOURTH_RANK, 1),
LottoRecord(Rank.THIRD_RANK, 0),
@@ -65,4 +65,4 @@ class LottoRecordsTest {
// Then
assertThat(actual).isEqualTo(0.35)
}
}
}
2 changes: 1 addition & 1 deletion src/test/kotlin/lotto/domain/WinningLottoTest.kt
Original file line number Diff line number Diff line change
@@ -78,4 +78,4 @@ class WinningLottoTest {
// Then
assertThat(actual.containsAll(Rank.values().toList())).isTrue()
}
}
}