From c8bc5f91f5b6f7d512aa5cfcef1f36a7bfe3eb28 Mon Sep 17 00:00:00 2001 From: Slowth-KIM Date: Wed, 9 Oct 2024 17:33:07 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[PR]=20chore=20:=20early=20return=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/racinggame/racingcar/RacingCars.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/racinggame/racingcar/RacingCars.java b/src/main/java/racinggame/racingcar/RacingCars.java index c346c0591b4..7d31bf9d559 100644 --- a/src/main/java/racinggame/racingcar/RacingCars.java +++ b/src/main/java/racinggame/racingcar/RacingCars.java @@ -11,11 +11,9 @@ private RacingCars(List cars) { } public static RacingCars create(MoveStrategy moveStrategy, List nameList) { - List cars = nameList.stream() + return nameList.stream() .map(name -> RacingCar.create(moveStrategy, name)) - .collect(Collectors.toList()); - - return new RacingCars(cars); + .collect(Collectors.collectingAndThen(Collectors.toList(), RacingCars::new)); } public int count() { From 7d09a409e9962d479c1cefe92b0b2d1c4020d609 Mon Sep 17 00:00:00 2001 From: Slowth-KIM Date: Wed, 9 Oct 2024 17:39:11 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[PR]=20chore=20:=20String.join=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/racinggame/ConsoleResultView.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/racinggame/ConsoleResultView.java b/src/main/java/racinggame/ConsoleResultView.java index b178ec3aec7..02cfe69892a 100644 --- a/src/main/java/racinggame/ConsoleResultView.java +++ b/src/main/java/racinggame/ConsoleResultView.java @@ -39,11 +39,10 @@ private String formatWinnersMessage(List winners) { } private String joinNames(List names) { - StringJoiner joiner = new StringJoiner(", "); - names.forEach(joiner::add); - return joiner.toString(); + return String.join(", ", names); } + private String createPositionMarker(int position) { return POSITION_MARKER.repeat(position); } From 287c595e64c0b0f929d1fa45c41c93708362065c Mon Sep 17 00:00:00 2001 From: Slowth-KIM Date: Wed, 9 Oct 2024 17:49:22 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[PR]=20chore=20:=20CarName=20=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20validation=20=EC=97=AD=ED=95=A0=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/racinggame/ConsoleInputView.java | 24 +++++-------------- .../java/racinggame/racingcar/CarName.java | 12 +++++++++- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/main/java/racinggame/ConsoleInputView.java b/src/main/java/racinggame/ConsoleInputView.java index ad5e97bed60..ca62e54a37a 100644 --- a/src/main/java/racinggame/ConsoleInputView.java +++ b/src/main/java/racinggame/ConsoleInputView.java @@ -1,5 +1,7 @@ package racinggame; +import racinggame.racingcar.CarName; + import java.util.List; import java.util.Scanner; import java.util.stream.Collectors; @@ -8,14 +10,11 @@ public class ConsoleInputView implements InputView { private static final String QUESTION_NAMES_OF_CARS = "경주할 자동차 이름을 입력하세요(이름은 쉼표(,)를 기준으로 구분)."; private static final String QUESTION_NUMBER_OF_ROUNDS = "시도할 회수는 몇 회 인가요?"; - - private static final String ERROR_INVALID_NAME = "자동차 이름은 5자 이하여야 합니다. 다시 입력해주세요."; private static final String ERROR_NOT_POSITIVE = "양수를 입력해주세요: "; private static final String ERROR_NOT_NUMBER = "숫자를 입력해주세요: "; private static final int ZERO = 0; private static final String NAME_SEPARATOR = ","; - private static final int MAX_NAME_LENGTH = 5; private final Scanner scanner; @@ -42,8 +41,10 @@ private void printMessage(final String message) { private List readValidNames() { try { List names = splitNames(readInput()); - validateNames(names); - return names; + return names.stream() + .map(CarName::new) // CarName 객체 생성, 이름을 검증함 + .map(CarName::getValue) + .collect(Collectors.toList()); } catch (RuntimeException e) { System.out.println(e.getMessage()); return readValidNames(); @@ -56,19 +57,6 @@ private List splitNames(String input) { .collect(Collectors.toList()); } - private void validateNames(List names) { - names.stream() - .filter(name -> !isValidName(name)) - .findFirst() - .ifPresent(invalidName -> { - throw new RuntimeException(ERROR_INVALID_NAME + ": " + invalidName); - }); - } - - private boolean isValidName(String name) { - return name.length() <= MAX_NAME_LENGTH; - } - private int readPositiveNumber() { String input = readInput(); try { diff --git a/src/main/java/racinggame/racingcar/CarName.java b/src/main/java/racinggame/racingcar/CarName.java index 1191c3bbee8..2769cd65531 100644 --- a/src/main/java/racinggame/racingcar/CarName.java +++ b/src/main/java/racinggame/racingcar/CarName.java @@ -1,13 +1,23 @@ package racinggame.racingcar; public class CarName { + private static final int MAX_NAME_LENGTH = 5; + private static final String ERROR_INVALID_NAME = "자동차 이름은 5자 이하여야 합니다."; + private final String value; public CarName(String value) { + validateName(value); this.value = value; } - String getValue() { + private void validateName(String name) { + if (name.length() > MAX_NAME_LENGTH) { + throw new IllegalArgumentException(ERROR_INVALID_NAME + ": " + name); + } + } + + public String getValue() { return value; } } From 17cad01fd86a4f94bb63ada71dd2339fb7f6dc33 Mon Sep 17 00:00:00 2001 From: Slowth-KIM Date: Wed, 9 Oct 2024 18:15:34 +0900 Subject: [PATCH 4/6] =?UTF-8?q?refactor=20:=20domain,=20view,=20controller?= =?UTF-8?q?=20=EB=A1=9C=20=ED=8C=A8=ED=82=A4=EC=A7=80=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => controller}/RacingGameController.java | 11 +++++++++-- .../racinggame/{racingcar => domain/race}/Race.java | 5 ++++- .../racinggame/{ => domain}/racingcar/CarName.java | 2 +- .../{ => domain}/racingcar/CarPosition.java | 2 +- .../racinggame/{ => domain}/racingcar/RacingCar.java | 4 +++- .../racinggame/{ => domain}/racingcar/RacingCars.java | 4 +++- .../{racingcar => domain/strategy}/MoveStrategy.java | 2 +- .../strategy}/RandomMoveStrategy.java | 2 +- .../java/racinggame/{ => view}/ConsoleInputView.java | 4 ++-- .../java/racinggame/{ => view}/ConsoleResultView.java | 3 +-- src/main/java/racinggame/{ => view}/InputView.java | 2 +- src/main/java/racinggame/{ => view}/ResultView.java | 2 +- src/test/java/racinggame/RaceTest.java | 6 +++--- src/test/java/racinggame/RacingCarCreationTest.java | 4 ++-- src/test/java/racinggame/RacingCarMovementTest.java | 6 +++--- src/test/java/racinggame/RacingGameInputViewTest.java | 1 + 16 files changed, 37 insertions(+), 23 deletions(-) rename src/main/java/racinggame/{ => controller}/RacingGameController.java (84%) rename src/main/java/racinggame/{racingcar => domain/race}/Race.java (91%) rename src/main/java/racinggame/{ => domain}/racingcar/CarName.java (93%) rename src/main/java/racinggame/{ => domain}/racingcar/CarPosition.java (85%) rename src/main/java/racinggame/{ => domain}/racingcar/RacingCar.java (89%) rename src/main/java/racinggame/{ => domain}/racingcar/RacingCars.java (91%) rename src/main/java/racinggame/{racingcar => domain/strategy}/MoveStrategy.java (62%) rename src/main/java/racinggame/{racingcar => domain/strategy}/RandomMoveStrategy.java (92%) rename src/main/java/racinggame/{ => view}/ConsoleInputView.java (97%) rename src/main/java/racinggame/{ => view}/ConsoleResultView.java (97%) rename src/main/java/racinggame/{ => view}/InputView.java (82%) rename src/main/java/racinggame/{ => view}/ResultView.java (90%) diff --git a/src/main/java/racinggame/RacingGameController.java b/src/main/java/racinggame/controller/RacingGameController.java similarity index 84% rename from src/main/java/racinggame/RacingGameController.java rename to src/main/java/racinggame/controller/RacingGameController.java index c40a78a4262..b0caf765418 100644 --- a/src/main/java/racinggame/RacingGameController.java +++ b/src/main/java/racinggame/controller/RacingGameController.java @@ -1,6 +1,13 @@ -package racinggame; +package racinggame.controller; + +import racinggame.domain.strategy.MoveStrategy; +import racinggame.domain.race.Race; +import racinggame.domain.strategy.RandomMoveStrategy; +import racinggame.view.ConsoleInputView; +import racinggame.view.ConsoleResultView; +import racinggame.view.InputView; +import racinggame.view.ResultView; -import racinggame.racingcar.*; import java.util.List; public class RacingGameController { diff --git a/src/main/java/racinggame/racingcar/Race.java b/src/main/java/racinggame/domain/race/Race.java similarity index 91% rename from src/main/java/racinggame/racingcar/Race.java rename to src/main/java/racinggame/domain/race/Race.java index 55671371274..30141c9f1d3 100644 --- a/src/main/java/racinggame/racingcar/Race.java +++ b/src/main/java/racinggame/domain/race/Race.java @@ -1,4 +1,7 @@ -package racinggame.racingcar; +package racinggame.domain.race; + +import racinggame.domain.racingcar.RacingCars; +import racinggame.domain.strategy.MoveStrategy; import java.util.List; import java.util.Map; diff --git a/src/main/java/racinggame/racingcar/CarName.java b/src/main/java/racinggame/domain/racingcar/CarName.java similarity index 93% rename from src/main/java/racinggame/racingcar/CarName.java rename to src/main/java/racinggame/domain/racingcar/CarName.java index 2769cd65531..c8c169b404e 100644 --- a/src/main/java/racinggame/racingcar/CarName.java +++ b/src/main/java/racinggame/domain/racingcar/CarName.java @@ -1,4 +1,4 @@ -package racinggame.racingcar; +package racinggame.domain.racingcar; public class CarName { private static final int MAX_NAME_LENGTH = 5; diff --git a/src/main/java/racinggame/racingcar/CarPosition.java b/src/main/java/racinggame/domain/racingcar/CarPosition.java similarity index 85% rename from src/main/java/racinggame/racingcar/CarPosition.java rename to src/main/java/racinggame/domain/racingcar/CarPosition.java index 02a6ca50a40..aa41a1865e1 100644 --- a/src/main/java/racinggame/racingcar/CarPosition.java +++ b/src/main/java/racinggame/domain/racingcar/CarPosition.java @@ -1,4 +1,4 @@ -package racinggame.racingcar; +package racinggame.domain.racingcar; public class CarPosition { private int value; diff --git a/src/main/java/racinggame/racingcar/RacingCar.java b/src/main/java/racinggame/domain/racingcar/RacingCar.java similarity index 89% rename from src/main/java/racinggame/racingcar/RacingCar.java rename to src/main/java/racinggame/domain/racingcar/RacingCar.java index 6de546a30f3..582839c42b4 100644 --- a/src/main/java/racinggame/racingcar/RacingCar.java +++ b/src/main/java/racinggame/domain/racingcar/RacingCar.java @@ -1,4 +1,6 @@ -package racinggame.racingcar; +package racinggame.domain.racingcar; + +import racinggame.domain.strategy.MoveStrategy; public class RacingCar { private final CarName name; diff --git a/src/main/java/racinggame/racingcar/RacingCars.java b/src/main/java/racinggame/domain/racingcar/RacingCars.java similarity index 91% rename from src/main/java/racinggame/racingcar/RacingCars.java rename to src/main/java/racinggame/domain/racingcar/RacingCars.java index 7d31bf9d559..d2bf192e50c 100644 --- a/src/main/java/racinggame/racingcar/RacingCars.java +++ b/src/main/java/racinggame/domain/racingcar/RacingCars.java @@ -1,4 +1,6 @@ -package racinggame.racingcar; +package racinggame.domain.racingcar; + +import racinggame.domain.strategy.MoveStrategy; import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/racinggame/racingcar/MoveStrategy.java b/src/main/java/racinggame/domain/strategy/MoveStrategy.java similarity index 62% rename from src/main/java/racinggame/racingcar/MoveStrategy.java rename to src/main/java/racinggame/domain/strategy/MoveStrategy.java index dd2fe92f874..fa595f19cfb 100644 --- a/src/main/java/racinggame/racingcar/MoveStrategy.java +++ b/src/main/java/racinggame/domain/strategy/MoveStrategy.java @@ -1,4 +1,4 @@ -package racinggame.racingcar; +package racinggame.domain.strategy; public interface MoveStrategy { boolean shouldMove(); diff --git a/src/main/java/racinggame/racingcar/RandomMoveStrategy.java b/src/main/java/racinggame/domain/strategy/RandomMoveStrategy.java similarity index 92% rename from src/main/java/racinggame/racingcar/RandomMoveStrategy.java rename to src/main/java/racinggame/domain/strategy/RandomMoveStrategy.java index a2979a18179..a7237256570 100644 --- a/src/main/java/racinggame/racingcar/RandomMoveStrategy.java +++ b/src/main/java/racinggame/domain/strategy/RandomMoveStrategy.java @@ -1,4 +1,4 @@ -package racinggame.racingcar; +package racinggame.domain.strategy; import java.util.Random; diff --git a/src/main/java/racinggame/ConsoleInputView.java b/src/main/java/racinggame/view/ConsoleInputView.java similarity index 97% rename from src/main/java/racinggame/ConsoleInputView.java rename to src/main/java/racinggame/view/ConsoleInputView.java index ca62e54a37a..30a5eda7424 100644 --- a/src/main/java/racinggame/ConsoleInputView.java +++ b/src/main/java/racinggame/view/ConsoleInputView.java @@ -1,6 +1,6 @@ -package racinggame; +package racinggame.view; -import racinggame.racingcar.CarName; +import racinggame.domain.racingcar.CarName; import java.util.List; import java.util.Scanner; diff --git a/src/main/java/racinggame/ConsoleResultView.java b/src/main/java/racinggame/view/ConsoleResultView.java similarity index 97% rename from src/main/java/racinggame/ConsoleResultView.java rename to src/main/java/racinggame/view/ConsoleResultView.java index 02cfe69892a..3fab609de5e 100644 --- a/src/main/java/racinggame/ConsoleResultView.java +++ b/src/main/java/racinggame/view/ConsoleResultView.java @@ -1,8 +1,7 @@ -package racinggame; +package racinggame.view; import java.util.List; import java.util.Map; -import java.util.StringJoiner; public class ConsoleResultView implements ResultView { private static final String EXECUTION_ANNOUNCEMENT_MESSAGE = "실행 결과"; diff --git a/src/main/java/racinggame/InputView.java b/src/main/java/racinggame/view/InputView.java similarity index 82% rename from src/main/java/racinggame/InputView.java rename to src/main/java/racinggame/view/InputView.java index ae3ee7ad36a..ae6b8929aa8 100644 --- a/src/main/java/racinggame/InputView.java +++ b/src/main/java/racinggame/view/InputView.java @@ -1,4 +1,4 @@ -package racinggame; +package racinggame.view; import java.util.List; diff --git a/src/main/java/racinggame/ResultView.java b/src/main/java/racinggame/view/ResultView.java similarity index 90% rename from src/main/java/racinggame/ResultView.java rename to src/main/java/racinggame/view/ResultView.java index 432bbe7ca6a..403156d7cfe 100644 --- a/src/main/java/racinggame/ResultView.java +++ b/src/main/java/racinggame/view/ResultView.java @@ -1,4 +1,4 @@ -package racinggame; +package racinggame.view; import java.util.List; import java.util.Map; diff --git a/src/test/java/racinggame/RaceTest.java b/src/test/java/racinggame/RaceTest.java index 2f6e99e76d6..223f3f157c4 100644 --- a/src/test/java/racinggame/RaceTest.java +++ b/src/test/java/racinggame/RaceTest.java @@ -3,9 +3,9 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; -import racinggame.racingcar.MoveStrategy; -import racinggame.racingcar.Race; -import racinggame.racingcar.RandomMoveStrategy; +import racinggame.domain.strategy.MoveStrategy; +import racinggame.domain.race.Race; +import racinggame.domain.strategy.RandomMoveStrategy; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/racinggame/RacingCarCreationTest.java b/src/test/java/racinggame/RacingCarCreationTest.java index b0938f07059..91dcb48b499 100644 --- a/src/test/java/racinggame/RacingCarCreationTest.java +++ b/src/test/java/racinggame/RacingCarCreationTest.java @@ -2,8 +2,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import racinggame.racingcar.MoveStrategy; -import racinggame.racingcar.RacingCars; +import racinggame.domain.strategy.MoveStrategy; +import racinggame.domain.racingcar.RacingCars; import java.util.Arrays; import java.util.List; diff --git a/src/test/java/racinggame/RacingCarMovementTest.java b/src/test/java/racinggame/RacingCarMovementTest.java index 4888a1d6cfc..922b452ddc8 100644 --- a/src/test/java/racinggame/RacingCarMovementTest.java +++ b/src/test/java/racinggame/RacingCarMovementTest.java @@ -2,9 +2,9 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import racinggame.racingcar.RacingCars; -import racinggame.racingcar.RandomMoveStrategy; -import racinggame.racingcar.MoveStrategy; +import racinggame.domain.racingcar.RacingCars; +import racinggame.domain.strategy.RandomMoveStrategy; +import racinggame.domain.strategy.MoveStrategy; import java.util.Arrays; import java.util.List; diff --git a/src/test/java/racinggame/RacingGameInputViewTest.java b/src/test/java/racinggame/RacingGameInputViewTest.java index 28bb0515377..7cd738370ac 100644 --- a/src/test/java/racinggame/RacingGameInputViewTest.java +++ b/src/test/java/racinggame/RacingGameInputViewTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.ValueSource; +import racinggame.view.ConsoleInputView; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; From 982b72dd3d1ec419cce9e78d275209b950fccb29 Mon Sep 17 00:00:00 2001 From: Slowth-KIM Date: Wed, 9 Oct 2024 18:20:50 +0900 Subject: [PATCH 5/6] =?UTF-8?q?refactor=20:=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=EB=8F=84=20=ED=8C=A8=ED=82=A4=EC=A7=80=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/racinggame/{ => domain/race}/RaceTest.java | 3 +-- .../{ => domain/racingcar}/RacingCarCreationTest.java | 3 +-- .../{ => domain/strategy}/RacingCarMovementTest.java | 4 +--- .../java/racinggame/{ => view}/RacingGameInputViewTest.java | 3 +-- 4 files changed, 4 insertions(+), 9 deletions(-) rename src/test/java/racinggame/{ => domain/race}/RaceTest.java (97%) rename src/test/java/racinggame/{ => domain/racingcar}/RacingCarCreationTest.java (95%) rename src/test/java/racinggame/{ => domain/strategy}/RacingCarMovementTest.java (94%) rename src/test/java/racinggame/{ => view}/RacingGameInputViewTest.java (98%) diff --git a/src/test/java/racinggame/RaceTest.java b/src/test/java/racinggame/domain/race/RaceTest.java similarity index 97% rename from src/test/java/racinggame/RaceTest.java rename to src/test/java/racinggame/domain/race/RaceTest.java index 223f3f157c4..8e5aecb21f3 100644 --- a/src/test/java/racinggame/RaceTest.java +++ b/src/test/java/racinggame/domain/race/RaceTest.java @@ -1,10 +1,9 @@ -package racinggame; +package racinggame.domain.race; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import racinggame.domain.strategy.MoveStrategy; -import racinggame.domain.race.Race; import racinggame.domain.strategy.RandomMoveStrategy; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/racinggame/RacingCarCreationTest.java b/src/test/java/racinggame/domain/racingcar/RacingCarCreationTest.java similarity index 95% rename from src/test/java/racinggame/RacingCarCreationTest.java rename to src/test/java/racinggame/domain/racingcar/RacingCarCreationTest.java index 91dcb48b499..4d84af163eb 100644 --- a/src/test/java/racinggame/RacingCarCreationTest.java +++ b/src/test/java/racinggame/domain/racingcar/RacingCarCreationTest.java @@ -1,9 +1,8 @@ -package racinggame; +package racinggame.domain.racingcar; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import racinggame.domain.strategy.MoveStrategy; -import racinggame.domain.racingcar.RacingCars; import java.util.Arrays; import java.util.List; diff --git a/src/test/java/racinggame/RacingCarMovementTest.java b/src/test/java/racinggame/domain/strategy/RacingCarMovementTest.java similarity index 94% rename from src/test/java/racinggame/RacingCarMovementTest.java rename to src/test/java/racinggame/domain/strategy/RacingCarMovementTest.java index 922b452ddc8..a0e0188987b 100644 --- a/src/test/java/racinggame/RacingCarMovementTest.java +++ b/src/test/java/racinggame/domain/strategy/RacingCarMovementTest.java @@ -1,10 +1,8 @@ -package racinggame; +package racinggame.domain.strategy; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import racinggame.domain.racingcar.RacingCars; -import racinggame.domain.strategy.RandomMoveStrategy; -import racinggame.domain.strategy.MoveStrategy; import java.util.Arrays; import java.util.List; diff --git a/src/test/java/racinggame/RacingGameInputViewTest.java b/src/test/java/racinggame/view/RacingGameInputViewTest.java similarity index 98% rename from src/test/java/racinggame/RacingGameInputViewTest.java rename to src/test/java/racinggame/view/RacingGameInputViewTest.java index 7cd738370ac..5115f37687f 100644 --- a/src/test/java/racinggame/RacingGameInputViewTest.java +++ b/src/test/java/racinggame/view/RacingGameInputViewTest.java @@ -1,4 +1,4 @@ -package racinggame; +package racinggame.view; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -7,7 +7,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.ValueSource; -import racinggame.view.ConsoleInputView; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; From ba35531c5da2385c0610dcb802301ed5fbeaa285 Mon Sep 17 00:00:00 2001 From: Slowth-KIM Date: Wed, 9 Oct 2024 18:22:37 +0900 Subject: [PATCH 6/6] =?UTF-8?q?refactor=20:=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=EC=9D=98=20=EC=9D=B4=EB=A6=84=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{RacingCarCreationTest.java => RacingCarsTest.java} | 2 +- .../strategy/{RacingCarMovementTest.java => StrategyTest.java} | 2 +- .../view/{RacingGameInputViewTest.java => InputViewTest.java} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/test/java/racinggame/domain/racingcar/{RacingCarCreationTest.java => RacingCarsTest.java} (97%) rename src/test/java/racinggame/domain/strategy/{RacingCarMovementTest.java => StrategyTest.java} (98%) rename src/test/java/racinggame/view/{RacingGameInputViewTest.java => InputViewTest.java} (99%) diff --git a/src/test/java/racinggame/domain/racingcar/RacingCarCreationTest.java b/src/test/java/racinggame/domain/racingcar/RacingCarsTest.java similarity index 97% rename from src/test/java/racinggame/domain/racingcar/RacingCarCreationTest.java rename to src/test/java/racinggame/domain/racingcar/RacingCarsTest.java index 4d84af163eb..f8344d605ac 100644 --- a/src/test/java/racinggame/domain/racingcar/RacingCarCreationTest.java +++ b/src/test/java/racinggame/domain/racingcar/RacingCarsTest.java @@ -10,7 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat; -class RacingCarCreationTest { +class RacingCarsTest { @Test @DisplayName("단일 자동차 객체 생성") diff --git a/src/test/java/racinggame/domain/strategy/RacingCarMovementTest.java b/src/test/java/racinggame/domain/strategy/StrategyTest.java similarity index 98% rename from src/test/java/racinggame/domain/strategy/RacingCarMovementTest.java rename to src/test/java/racinggame/domain/strategy/StrategyTest.java index a0e0188987b..d8bfa7aefbc 100644 --- a/src/test/java/racinggame/domain/strategy/RacingCarMovementTest.java +++ b/src/test/java/racinggame/domain/strategy/StrategyTest.java @@ -10,7 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat; -class RacingCarMovementTest { +class StrategyTest { private static final int INIT_POSITION = 0; private static final int NUMBER_OF_ROUNDS = 4; diff --git a/src/test/java/racinggame/view/RacingGameInputViewTest.java b/src/test/java/racinggame/view/InputViewTest.java similarity index 99% rename from src/test/java/racinggame/view/RacingGameInputViewTest.java rename to src/test/java/racinggame/view/InputViewTest.java index 5115f37687f..62ed3fc851e 100644 --- a/src/test/java/racinggame/view/RacingGameInputViewTest.java +++ b/src/test/java/racinggame/view/InputViewTest.java @@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; -class RacingGameInputViewTest { +class InputViewTest { private final InputStream originalSystemIn = System.in; private final PrintStream originalSystemOut = System.out;