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

[step4] 로또 (수동) #1123

Open
wants to merge 9 commits into
base: sarahan774
Choose a base branch
from
Open

Conversation

SaraHan774
Copy link

피드백 미리 감사드립니다.

  • model 패키지 제거
  • 일부 도메인 로직에 대해 테스트 커버리지 확인 후 테스트코드 보강
  • 논리 오류가 아닌 경우 예외처리 대신 null 반환

Copy link

@vsh123 vsh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요!

step4까지 작성 잘해주셨네요 👍

몇가지 코멘트를 남겼으니 확인부탁드릴게요!

@@ -50,4 +50,15 @@ object LottoController {
)
return result
}

private fun createMyLottoList(totalLottoCount: Int): List<Lotto> {
val manualLottoCount = InputView.readManualLottoCount(InputView.ENTER_MANUAL_LOTTO_COUNT)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InputView에 InputView의 메시지를 넣어주는 방식으로 변경하신 이유가 있을까요~?

프롬프트 메시지는 View의 영역이라고 생각해서요!

private fun readManualLotto(): List<Int> {
val input =
readlnOrNull()?.trim()
?.split(",")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

매직넘버가 보이네요 :)

val input =
readlnOrNull()?.trim()
?.split(",")
?.map { it.trim().toIntOrNull() ?: 0 }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OrNull 이후에 throw가 아닌 0으로 결정하신 이유가 있을까요??
View에서 숫자가 아닌경우의 validation은 해줘도 되지 않을까싶어요!

promptMessage: String,
count: Int,
): List<List<Int>> {
val manualLottoNumberList = mutableListOf<List<Int>>()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://tecoble.techcourse.co.kr/post/2020-04-24-variable_naming/

네이밍에 대해 고민해보고 List postfix를 붙이는 것에 대한 고민을 해보면 어떨까요?

}

private fun autoGeneratedLottoList() =
List(autoGeneratedLottoCount) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autoGeneratedLottoCount가 음수가 될 확률은 없을까요!?

}
}

private fun autoGeneratedLottoList() =
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중괄호 없이 단일 표현식으로 작성을 해주셨는데요!

단일 표현식으로 작성하시는 기준이 있을까요~?

@@ -23,8 +23,8 @@ object LottoController {
// 총 구매 로또 개수
ResultView.printTotalPurchaseCount(totalLottoCount)

val myLottoList = createMyLottoList(totalLottoCount)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

당첨번호라는 의미를 가진 변수인데, myLotto가 괜찮을기 고민 해보면 좋을 것 같아요 :)

@@ -1,4 +1,4 @@
package lotto.domain.model
package lotto.domain

@JvmInline
value class Lotto(val value: List<LottoNumber>) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지금보니까 LottoTest가 없네요!! 테스트를 작성해보면 어떨까요?

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