Open
Conversation
ghost
reviewed
May 30, 2020
| List<String> resultNames = DataProvider.getResultNames(names, resultName); | ||
| List<Integer> nameNumbers = DataProvider.getResultNameNumbers(names, resultNames); | ||
| List<Integer> matchNumbers = DataProvider.getMatchNumbers(ladder, nameNumbers); | ||
| List<String> matchItems = DataProvider.getMatchItems(items, matchNumbers); |
There was a problem hiding this comment.
DataProvider는 사다리 타기를 진행하고 게임결과를 생성하는 역할을 하고 있네요
컨트롤러에서 DataProvider의 각 메서드를 호출하기보다는 사다리 타기를 진행하는 객체에게 역할을 위임하면 어떨까요
| } | ||
|
|
||
| private static int move(Line line, int current) { | ||
| if (current == 0 && line.connected(current)) { |
There was a problem hiding this comment.
current == 0 을 메서드로 추출하면 더 의미를 이해하는데 도움이 될 것 같네요
line.isFirstLocation(current)
| expectedItems.add("꽝4"); | ||
| expectedItems.add("꽝1"); | ||
| expectedItems.add("꽝3"); | ||
| assertThat(matchItems).isEqualTo(expectedItems); |
There was a problem hiding this comment.
List<String> expectedItems = new ArrayList<>();
expectedItems.add("꽝2");
expectedItems.add("꽝4");
expectedItems.add("꽝1");
expectedItems.add("꽝3");
이 부분도 given에 있으면 좋을것같아요
|
|
||
| assertThat(firstConnected).isTrue(); | ||
| assertThat(secondConnected).isFalse(); | ||
| assertThat(thirdConnected).isTrue(); |
There was a problem hiding this comment.
비교할 Ladder를 만들어서 검증하도록 해봐요:)
List<Line> testLadder = ... ;
assertThat(ladder).isEqualTo(testLadder);
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.
No description provided.