Skip to content

Commit

Permalink
refactor: 패키지 위치 원래대로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
riyenas0925 committed Nov 20, 2022
1 parent 57b1c77 commit 79f0885
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 24 deletions.
5 changes: 0 additions & 5 deletions src/main/kotlin/racingcar/Application.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
package racingcar

import racingcar.domain.RacingCarNumberGenerator
import racingcar.domain.RacingGame
import racingcar.view.InputView
import racingcar.view.ResultView

fun main() {
val cars = InputView.readCars()
val roundCount = InputView.readRoundCount()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package racingcar.domain
package racingcar

class Car(
private var _location: Int = 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package racingcar.view

import racingcar.domain.Car
package racingcar

private const val VALID_CAR_NAME_LENGTH = 5

Expand All @@ -10,7 +8,7 @@ object InputView {
val names = parseCarName(readln())

val list = mutableListOf<Car>()
for(name in names) {
for (name in names) {
require(isValidLength(name)) { "글자수는 5자를 넘을 수 없어요" }

list.add(
Expand All @@ -30,7 +28,7 @@ object InputView {
return name.length <= VALID_CAR_NAME_LENGTH
}

private fun parseCarName(input :String): List<String> {
private fun parseCarName(input: String): List<String> {
return input.split(",")
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package racingcar.domain
package racingcar

enum class MovingJudgeRule(
private val expression: (Int) -> (Boolean),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package racingcar.domain
package racingcar

enum class MovingStrategy(
private val expression: (Int) -> (Int)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package racingcar.domain
package racingcar

interface NumberGenerator {
fun rand(): Int
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package racingcar.domain
package racingcar

class RacingGame(
private val cars: List<Car>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package racingcar.view

import racingcar.domain.Car
package racingcar

object ResultView {
fun print(cars: List<Car>) {
Expand Down
1 change: 0 additions & 1 deletion src/test/kotlin/racingcar/CarTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package racingcar

import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe
import racingcar.domain.Car

class CarTest : StringSpec({

Expand Down
1 change: 0 additions & 1 deletion src/test/kotlin/racingcar/MovingJudgeRuleTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package racingcar

import io.kotest.core.spec.style.BehaviorSpec
import io.kotest.matchers.shouldBe
import racingcar.domain.MovingJudgeRule

class MovingJudgeRuleTest : BehaviorSpec({

Expand Down
1 change: 0 additions & 1 deletion src/test/kotlin/racingcar/MovingStrategyTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package racingcar

import io.kotest.core.spec.style.BehaviorSpec
import io.kotest.matchers.shouldBe
import racingcar.domain.MovingStrategy

class MovingStrategyTest : BehaviorSpec({

Expand Down
3 changes: 0 additions & 3 deletions src/test/kotlin/racingcar/RacingGameTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe
import io.mockk.every
import io.mockk.mockk
import racingcar.domain.Car
import racingcar.domain.NumberGenerator
import racingcar.domain.RacingGame

class RacingGameTest : StringSpec({
"레이싱 게임은 매 횟수마다 자동차의 현재 위치를 보여줘요" {
Expand Down

0 comments on commit 79f0885

Please sign in to comment.