Open
Conversation
KyunghoYeom
reviewed
Mar 25, 2024
| private static final String NOT_POSITIVE_INTEGER = "시도 횟수는 정수여야 합니다"; | ||
| public static List<String> parseNames(String input) { | ||
| return Arrays.stream(input.split(",")) | ||
| .map(String::trim) |
There was a problem hiding this comment.
저는 공백을 포함하는 이름이 나왔을 때는 오류 처리를 하게 하였는데(이름 중간에 공백 나오면 에러) trim을 통해 이름 앞 뒤 공백을 없애는 방법으로 코드 작성하는 방식이 예외 처리 허용 부분에서저랑 좀 다르게 작성한 것 같습니다..!
KyunghoYeom
reviewed
Mar 25, 2024
| private final RandomNumberGenerator randomNumberGenerator; | ||
|
|
||
| public RacingCarController() { | ||
| this.randomNumberGenerator = new RandomNumberGenerator(); |
There was a problem hiding this comment.
혹시controller 생성자에서 random하게 0~9까지의 수를 결정해 제공하는 클라스 객체를 생성한 이유가 있으신지 궁금합니다!
KyunghoYeom
reviewed
Mar 25, 2024
| return new Cars(carNames); | ||
| } catch (IllegalArgumentException e) { | ||
| System.out.println(e.getMessage()); | ||
| return getCars(); //올바른 입력 넣을 때까지 반복 |
There was a problem hiding this comment.
저는 올바른 입력(차 이름 또는 반복 횟수)이 오지 않았을 때 바로 프로그램을 종료하게 코드를 작성했는데 계속 반복적으로 제대로 입력될 때 까지 받게 코드 작성하신 부분에서 저랑 좀 차이가 있는 것 같습니다
otter2023
reviewed
Mar 25, 2024
|
|
||
| public class TryCount { | ||
|
|
||
| private static final String NOT_POSITIVE_INTEGER_MESSAGE = "시도 횟수는 양의 정수여야 합니다"; |
Member
There was a problem hiding this comment.
에러 메세지는 Enum Class를 사용해서 따로 모아두는 방법도 좋을 것 같아요!
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
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.
지난번에 test가 안 되던 문제는 설정 문제라 해결했고, test 작성법이 익숙하지 않아 코드 참고하며 작성했습니다.
Cars도 테스트를 작성해보고 싶은데 어떻게 해야 할 지 모르겠어서 비워져 있는 상태입니다.
docs에 README를 작성해봤는데 없는 것보다는 확실히 나은 것 같습니다.