Skip to content

Conversation

@chapitak
Copy link
Contributor

TDD로 다시 짜는 것을 하지 못하고 단위테스트 몇 개를 붙이는데 멈추고 말았습니다...

@Deocksoo Deocksoo self-requested a review January 11, 2020 00:26
Copy link

@Deocksoo Deocksoo left a comment

Choose a reason for hiding this comment

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

전반적으로 깔끔하게 잘 작성해주신 것 같아요 👍
간단한 피드백 몇 개만 코멘트로 남겨두었습니다.
java collection과 관련된 이야기는 아마도 오늘 다루는 주제들 중 하나일 것 같은데,
한번 고민해보시고 반영해주시면 좋을 것 같아요 :)

public class Car {

private static final double GO_FLOOR = 0.4;
private static final double GO_THRESHOLD = 0.4;

Choose a reason for hiding this comment

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

👍

winnerList.add("a");
winnerList.add("b");
winnerList.add("c");
winnerList.equals(racingCarGamePlay.getWinner(racingCarGamePlay.makeCars(targetCarNames)));

Choose a reason for hiding this comment

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

동작을 검증하는 부분이 필요할 것 같아요!

String[] targetCarNames = {"a", "b", "c"};
String testString = "a,b,c";
String[] splitedCarNames = RacingCarGame.makeCarNames(testString);
assertEquals(true, Arrays.equals(splitedCarNames,targetCarNames));

Choose a reason for hiding this comment

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

makeCarNames에서 배열 대신 collection을 리턴하면 이 부분도 조금 더 간결해질 수 있을거같아요.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

변경했습니다... 감사합니다..

@Test
void testGetWinner() {
String[] targetCarNames = {"a", "b", "c"};
RacingCarGamePlay racingCarGamePlay = new RacingCarGamePlay(targetCarNames, 0);

Choose a reason for hiding this comment

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

테스트에서도 하드코딩된 숫자를 추출하면 더 쉽게 읽을 수 있을것 같아요 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

테스트를 지워버렸어요!

@kwangilcho kwangilcho requested a review from Deocksoo February 8, 2020 02:51
@chapitak
Copy link
Contributor Author

chapitak commented Feb 9, 2020

re-request review 버튼이 안보여용 ㅠ

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