-
Notifications
You must be signed in to change notification settings - Fork 54
[김성은_BackEnd]1주차 과제 제출합니다 #61
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
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 class GameController { | ||
|
|
||
| private static GameController gameController; |
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.
모든 클래스를 싱글톤으로 하신 이유가 있을까요?
매번 close로 초기화한다면 new로 주입하는게 더 나았을 수도 있지 않았을지 궁금합니다.
|
|
||
| import message.GameMessage; | ||
|
|
||
| public class GameInputException { |
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.
커스텀 예외 좋네요. 어떻게 알게되었는지도 궁금합니다 👍
| gameController = null; | ||
| } | ||
|
|
||
| } 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.
https://velog.io/@junho5336/No-newline-at-end-of-file
개행 경고에 대한 해결법입니다!
| @Test | ||
| void 전체기능_확인() { | ||
| assertRandomNumberInRangeTest( | ||
| () -> { | ||
| run("a,b,c", "3"); | ||
| assertThat(output()).contains("a : -", "b : -","c : ", | ||
| "a : --", "b : --","c : ", | ||
| "a : ---", "b : ---","c : -","최종 우승자 : a, b"); | ||
| }, | ||
| 4,4,3,4,4,2,4,4,4 | ||
| ); | ||
| } | ||
|
|
||
| @Test | ||
| void 회수가_0일때() { | ||
| assertRandomNumberInRangeTest( | ||
| () -> { | ||
| run("a,b,c", "0"); | ||
| assertThat(output()).contains("최종 우승자 : a, b, c"); | ||
| }, | ||
| -1,-1,-1 | ||
| ); | ||
| } | ||
|
|
||
| @Test | ||
| void 음수에_대한_예외_처리() { | ||
| assertSimpleTest(() -> | ||
| assertThatThrownBy(() -> runException("pobi,a", "-11")) | ||
| .isInstanceOf(IllegalArgumentException.class) | ||
| ); | ||
| } | ||
|
|
||
| @Test | ||
| void 회수가_0으로_시작할_때_예외_처리() { | ||
| assertSimpleTest(() -> | ||
| assertThatThrownBy(() -> runException("pobi,a", "01")) | ||
| .isInstanceOf(IllegalArgumentException.class) | ||
| ); | ||
| } |
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.
테스트 굿입니다. 👍
| @@ -0,0 +1,31 @@ | |||
| package domain; | |||
|
|
|||
| public class Car implements Comparable<Car> { | |||
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.
domain과 model의 차이점을 알아두시면 좋을 것 같습니다.
열심히 서치도 하고 보고서 내용에 기반해 공부도 해보았으나 아직 스스로 과제를 해결할 정도의 실력이 아니라서 인터넷에서 찾은 어떤 분의 깃허브 코드를 참고하였습니다.
출처:https://0bliviat3.tistory.com/61