Skip to content

Commit

Permalink
[Style] 코드컨벤션
Browse files Browse the repository at this point in the history
  • Loading branch information
0702Yoon committed Jan 12, 2024
1 parent b164e60 commit d5630da
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/com/mjucow/eatda/common/vo/Latitude.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ value class Latitude(
val value: Double,

Check warning on line 8 in src/main/kotlin/com/mjucow/eatda/common/vo/Latitude.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/com/mjucow/eatda/common/vo/Latitude.kt#L8

Added line #L8 was not covered by tests
) {
init {
if (LATITUDE_MIN > value || LATITUDE_MAX < value) {
if (LATITUDE_MIN > value || LATITUDE_MAX < value) {
throw IllegalArgumentException()
}
}

companion object{
companion object {
private const val LATITUDE_MIN = -90.0
private const val LATITUDE_MAX = 90.0
}
Expand Down
7 changes: 2 additions & 5 deletions src/main/kotlin/com/mjucow/eatda/common/vo/Longitude.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ value class Longitude(
@JsonProperty(value = "longitude")
val value: Double,

Check warning on line 8 in src/main/kotlin/com/mjucow/eatda/common/vo/Longitude.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/com/mjucow/eatda/common/vo/Longitude.kt#L8

Added line #L8 was not covered by tests
) {

init {
if ( LONGITUDE_MIN > value || LONGITUDE_MAX < value) {
if (LONGITUDE_MIN > value || LONGITUDE_MAX < value) {
throw IllegalArgumentException()
}
}

companion object{
companion object {
private const val LONGITUDE_MIN = 0.0
private const val LONGITUDE_MAX = 180.0

}
}
2 changes: 1 addition & 1 deletion src/test/kotlin/com/mjucow/eatda/common/vo/LatitudeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LatitudeTest : VOTest {

@DisplayName("위도의 범위가 올바르면 객체가 생성된다.")
@ParameterizedTest
@ValueSource(doubles = [-Double.MAX_VALUE,-91.0, 91.0,Double.MAX_VALUE])
@ValueSource(doubles = [-Double.MAX_VALUE, -91.0, 91.0, Double.MAX_VALUE])
fun throwExceptionWhenInvalidNumber(value: Double) {
// given

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ class LongitudeTest : VOTest {
// then
assertThat(isEqaulsAndSameHashcode).isTrue()
}

}

0 comments on commit d5630da

Please sign in to comment.