-
Notifications
You must be signed in to change notification settings - Fork 55
[김민석_Backend] 2주차 과제 제출합니다. #50
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
base: main
Are you sure you want to change the base?
Conversation
ImTotem
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고했습니다.
리뷰 확인해주세요
| } | ||
| return winnerList; | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @DisplayName("실행") | ||
| @Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 프로그램 진입점은 테스트를 위한 코드가 아닌데 Test를 붙인 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트 관련해서 이것저것 알아보다 추가하고 방치한 것 같네요.
| public static void main(String[] args) { | ||
| // TODO: 프로그램 구현 | ||
| System.out.println("경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)"); | ||
| String input=Console.readLine(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
가독성을 생각해보면 좋을거 같아요
자바 코딩 컨벤션에 대해 찾아보세요~
| }catch(IllegalArgumentException e) { | ||
| System.out.println("잘못된 값이 입력되어서 종료합니다."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IllegalArgumentException이 발생하면 알아서 종료될건데 catch해서 다시 print 해주고 종료하는 이유가 있나요?
print보단 커스텀 exception을 만들어서 종료해보는건 어떨까요
|
|
||
| import static org.assertj.core.api.Assertions.*; | ||
|
|
||
| public class RacingCar { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RacingCar로 네이밍한 이유가 있나요?
RacingCar보다는 RacingGame 같은게 더 알맞지 않을까요? 아니면 RacingCars로 여러대를 포함하고 있음을 알려주는게 좋을 것 같다고 생각해요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 변수명 뭘로 할까 고민하다 생각 안 나서 그냥 RacingCar로 한 걸로 기억합니다.
| input=Console.readLine(); | ||
| n= getTurn(input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input을 가져오는것도 getTurn의 일부로 볼 수 있지 않을까요?
src/main/java/racingcar/Car.java
Outdated
| int distance; | ||
|
|
||
| public Car(String name) { | ||
| name=name.replaceAll(" ",""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
공백을 없애준 이유가 있나요?
이름의 앞과 맨 마지막에 잘못 들어간 공백만 지워주는건 어떤가요?
| winnerList=winnerList.concat(car[i].name); | ||
| winnerList=winnerList.concat(", "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringBuilder에 대해 알아보면 좋을거 같아요~
| assertThatThrownBy(() -> runException("pobi,javaji", "1")) | ||
| .isInstanceOf(IllegalArgumentException.class) | ||
| assertThatCode(() -> runException("pobi,javaji", "1")) | ||
| .doesNotThrowAnyException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여러 예외 상황이 있었을건데 최대한 많은 부분에 대해서 테스트 해보면 좋을것 같아요.
No description provided.