-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #6123
Step3 #6123
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.
예준님 3단계 너무 잘 끝내주셨네요 👍
크게 리뷰 드릴 부분은 없는 것 같아서
바로 머지할게요
수고하셨습니다!
import racingcar.view.InputView; | ||
import racingcar.view.ResultView; | ||
|
||
public class Main { |
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.
테스트 케이스 잘 작성해 주신 것 처럼
README.md
에도 내가 처리할 요구사항을 먼저 정리해 보면 어떨까 싶어요!
- 기능을 구현하기 전에 README.md 파일에 구현할 기능 목록을 정리해 추가한다.
- git의 commit 단위는 앞 단계에서 README.md 파일에 정리한 기능 목록 단위로 추가한다.
참고문서: AngularJS Commit Message Conventions
RacingGame racingGame = new RacingGame(new InputView(), new ResultView(), new JavaUtilRandomNumberGenerator()); | ||
racingGame.play(); |
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.
👍 👍
|
||
import java.util.Random; | ||
|
||
public class JavaUtilRandomNumberGenerator implements RandomNumberGenerator { |
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.
인터페이스 도출된 것은 너무 좋은데 네이밍이 쪼끔 아쉽네요!
BoundaryRandomNumberGenerator
같은 네이밍을 주면 더 자연스럽지 않을까요?
new BoundaryRandomNumberGenerator(범위)
참고만 해주세요~
@CsvSource({"2,false", "3,false", "4,true", "5,true", "6,true", "7,true", "8,true"}) | ||
public void carIsMovableWhenRandomLTE4(int random, boolean expected) { |
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.
👍 👍
만약 범위가 1에서 1억 사이라면
모든 범위를 테스트하기에는 불가능할 것 같아요
4
라는 수에 경계를 두고 전후만 체크한다면 어떨까요?
public class StubRandomNumberGenerator implements RandomNumberGenerator { | ||
private int fixedValue; | ||
|
||
public void setFixedValue(int fixedValue) { | ||
this.fixedValue = fixedValue; | ||
} | ||
|
||
@Override | ||
public int generate(int max) { | ||
return fixedValue; | ||
} |
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 void play() { | ||
inputView.initGameInput(); | ||
initializeCars(inputView.getNumberOfCars()); | ||
runRace(inputView.getAttemptCount()); | ||
resultView.printResult(); | ||
} |
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.
이미 MVC 패턴에 익숙하신 것 같네요 😄
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.